razznitin
razznitin

Reputation: 79

Not getting user email address in inquiry from Laravel app

I am stuck into a small issue. When a user sends an inquiry from laravel website, I get to see fixed email address in the from section. Is there any way out to make it dynamic. I want to see user's email address in the inbox.

Here's my .env code:

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=12345
MAIL_ENCRYPTION=ssl

When I reply the same email back, I can see the user's email in reply to field.

Please let know, where should I make changes. Also let me know if you require detail view into other code.

Upvotes: 1

Views: 72

Answers (1)

Mike S
Mike S

Reputation: 1646

The short answer is you should not try to spoof the email coming from the user. This can lead to issues like your email provider flagging the message as spam and possibly your webhost getting flagged as a spammer. The better practice is to have your email delivered from your [email protected] account as you currently do and then set the reply-to as it sounds like the app is already doing.

Upvotes: 1

Related Questions