Nezo96-39273050's avatar

The message was rejected because an invalid sender address was used in the 'From' header or in the 'MAIL FROM' command

I want to add sender address to email to be able reply to email directly from webmail but when i try to add 'from' to Envelope :

return new Envelope(
            from: new Address('[email protected]'),
            subject: 'Test Contact Email',
        );

i got error that invalid sender address was used. If i remove this from everything works and email is delivered. 🤨

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

The server you are using for sending email must be happy to forward email from an account pretending to be [email protected].

You can't just send email from any email addess you like as this is spoofing.

Nezo96-39273050's avatar

@Snapey dam, you are right, i used wrong email address in Mail::to() also i added replyTo to envelope function, now i am able to reply to sender email. Thank you.

return new Envelope(
            replyTo: [$this->data['email']],
            subject: 'Test Contact Email',
        );

Please or to participate in this conversation.