Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How do i obtain my smtp host?
- <mailSettings>
- <smtp from="makovetskiyd@yahoo.co.uk">
- <network host="localhost" port="25" userName="username" password="secret" defaultCredentials="true" />
- </smtp>
- </mailSettings>
- MailMessage message = new MailMessage();
- message.From = new MailAddress("makovetskiyd@yahoo.co.uk");
- message.To.Add(new MailAddress("makovetskiyd@yahoo.co.uk"));
- message.CC.Add(new MailAddress("makovetskiyd@yahoo.co.uk"));
- message.Subject = "This is my subject";
- message.Body = "This is the content";
- SmtpClient client = new SmtpClient();
- client.Send(message);
- <mailSettings>
- <smtp from="makovetskiyd@yahoo.co.uk">
- <network host="smtp.yahoo.com" port="25" userName="username" password="secret" defaultCredentials="true" />// where do i get the host?!? the host prevents me from sending an email
- </smtp>
- </mailSettings>
- using System.Configuration;
- using System.Web.Configuration;
- using System.Net.Configuration;
- Configuration configurationFile = WebConfigurationManager.OpenWebConfiguration("PathToConfigFile");
- configurationFile = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath)
- MailSettingsSectionGroup mailSettings = configurationFile.GetSectionGroup("system.net/mailSettings") as MailSettingsSectionGroup;
Add Comment
Please, Sign In to add comment