Hi
I got a API key: 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
from sendGrid.
I wrote codes for send an Email on form submission. It is not work, but after preview I saw " message:“success”.
Thank you in advance.
Hi Jack,
I’ve tried your code and it works for me. I replaced the recipient with my email address and received the email.
Did you check the spam folder?
If it’s not there, I assume the email might be automatically rejected by the recipient’s mail server (yahoo.com) because the domain of the sending server probably didn’t match to the domain of the sender (outlook.com).
As far as I know, in your SendGrid account you have to add a record for SendGrid mail servers to your domain in order to verify it (see “Settings” → “Sender Authentication”). After that, it’s better to use the domain for the sender (let’s say, if you’ve verified “em1234.example.com”, the sender should be “name@example.com” so that the domain of the mail server matches to the domain of the sender).