Avoid Gmail's “This message may not have been sent by” using sender header

前端 未结 1 451
暗喜
暗喜 2021-02-07 17:14

I\'m creating an email a friend type system where I need our mail server to send emails from the user of the site to their friend, i.e. from fred@gmail.com, to tony@gmail.com.

1条回答
  •  温柔的废话
    2021-02-07 17:56

    If gmail doesn't fail miserably, you have no way to suppress this warning.
    Google is in control of both accounts and therefore knows, that this mail wasn't send by fred using their infrastructure.
    There was used some third party infrastructure (yours) and this is all this warning is about. You can set an arbitrary email address as "from" and Google has no knowledge if this is legitimate use (if fred really wrote the message). Anyone could have written that message. Normally fred would use Googles infrastructure to send mails and then they would know its him.

    A cleaner solution would be to put your email address ("noreply@company.com") as from header (that would be honest) and set fred@gmail.com as reply-to header (so he gets the replies).

    0 讨论(0)
提交回复
热议问题