portfolio-website icon indicating copy to clipboard operation
portfolio-website copied to clipboard

Contact Form <[email protected]>

Open sjcrippa opened this issue 1 year ago • 2 comments

Hi, I've a question, what should we do with the "from" prop that we hardcode with "Contact Form [email protected]" ?? Shouldn't the senderEmail go there? Because when I put it on it doesn't work. Thx!!!!

sjcrippa avatar Mar 19 '24 21:03 sjcrippa

you can put the sender's email to the "from" property of the resend.emails.send() function by doing so

try { 
        await resend.emails.send({
            from: `${senderEmail} <[email protected]>`,
            to: "[email protected]", // can only send to the email that has been registered in the resend website.
            subject: "Contacting from the portfolio",
            reply_to: senderEmail as string,
            react: React.createElement(Email_styled, {
                message: message as string,
                senderEmail: senderEmail as string,
            }),
        });
    } catch (e: unknown) {
        return giveMeTheError(e);
    }

Prajwalg19 avatar Mar 26 '24 08:03 Prajwalg19

Okay thanks, I tested it and fails but I think that it's because I need a domain (it's seems that vercel's domains also doesn't work) to verify into Resend server.

sjcrippa avatar Apr 04 '24 01:04 sjcrippa