Pergunta

I have a problem when sending an email in C# using SMTP.

I have an SMTP host

mysmtphost.mydomain.com

while my email is

myname@mydomain.com

When I check the mail message object right before then call

smtpClient.Send(message) 

it states from

myname@mydomain.com

However when the message is received by the user, the from address is

myname@mysmtphost.mydomain.com

I have tried on a different smtp server (smtp.mydomain.com) and everything works fine. Any clues?

Foi útil?

Solução

It looks like your outgoing SMTP server (mysmtphost.mydomain.com) is re-writing the headers on the message, replacing the sender's address myname@mydomain.com with myname@mysmtphost.mydomain.com. This is not unusual - Gmail's outgoing smtp server (smtp.gmail.com) does this as well.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top