Hi,
I am trying to send email using rcpt to. I had set from address(from@domain.com) but at the receiver and it show actual email address (auth@domain.com). Can you please help me to solve this problem? Here is my code.
Smtp smtp = new Smtp();
smtp.Connect("smtp.gmail.com", SslMode.Explicit);
smtp.Login("auth@domain.com", password, SmtpAuthentication.Login);
string mailFrom = "from@domain.com";
string rcptTo = "rcptTo@domain.com";
string mailTo = "to@domain.com";
MailMessage mail = new MailMessage();
mail.To = mailTo;
mail.From = mailFrom;
mail.Headers.Add("From", mailFrom);
mail.Subject = "Hello Freddy, this is your friend Peter sending you a test email";
mail.BodyText = "Hello Freddy, this is the body text";
//smtp.Send(mail);
smtp.Send(mail, mailFrom, rcptTo);
I tried with sample that I got from the website. But I still got same error. It behave same for both Send method.