sendgrid / sendgrid-php

The Official Twilio SendGrid PHP API Library
https://sendgrid.com
MIT License
1.49k stars 623 forks source link

How to specify a custom sender? #1058

Closed cod3rshotout closed 3 years ago

cod3rshotout commented 3 years ago

I'm using the $email->setFrom('no-reply@example.com'); method and it's working fine for email delivered to the registered sender. However, the email is delivered as no-reply@example.com.
How can I include the email of the customer that has filled the form? Eh: mario@gmail.com?

If I replace $email->setFrom('mario@gmail.com'); I will get 403. Is there a way to use setaFrom using a custom email?

JenniferMah commented 3 years ago

Hi @cod3rshotout! Have you gone through the sender verification process?

cod3rshotout commented 3 years ago

Solution:

$email->setReplyTo("mario@gmail.com");