I have developed an ASP.NET webforms application. I'm trying to send a form filled to an internal account and then a copy to the email account of the user. I dont get any errors. Internal mails are sent while external emails dont get sent. I also noticed I could not send email from a some of my email accounts to external emails like gmail or yahoo, from even an email client application Here is the line of code : SmtpClient smtpClient = new SmtpClient("mail.domainhost.co.uk",25); NetworkCredential credentials = new NetworkCredential("userName", "password"); smtpClient.Credentials = credentials; MailMessage mailMessage = new MailMessage(FromAddress,ToAddress,Enquiry,Message); mailMessage.IsBodyHtml=true; mailMessage.Priority = MailPriority.High; int i = 0; try { smtpClient.Send(mailMessage); i = 1; } catch(Exception e) { i = 0; } return i; Can I get help with this please?
When supplying SMTP authentication, make sure you use the full email address and password to that email address.