<system.net> <mailSettings> <smtp> <network host="mail.mydomain.com" userName="mymail@mydomain.com" password="password" /> </smtp> </mailSettings> </system.net>
MailMessage msg = new MailMessage("senderMail", "recieverMail"); msg.body = "body text"; msg.subject = "msg subject"; SmtpClient smtp = new SmtpClient(); smtp.Send(msg);
...The server response was: From domain must match authenticated domain...
Quote:When sending email using WebSecureStores SMTP server the from address must match the authenticated address in order to send. Some devices and email software will have the site or device authenticate with a email configured for the site for example admin@mydomain.com. Then the logged in user on the site or device with email user@mydomain.com that has privileged level to send email will use the software to send an email. When they do this the SMTP header will show the authenticated user as admin@mydomain.com and the sender as user@mydomain.com this will cause an error "rsp: 550 From address must match authenticated address" and the email will not be delivered. If you authenticate on the SMTP server with the user named "admin@mydomain.com" then you must also send the email using "admin@mydomain.com".
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)