Guest User

Untitled

a guest
Aug 13th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. Username: noreply@domain.com
  2. Password: password123
  3. Incoming Server: mail.domain.com (IMAP Port: 993, POP3 Port: 995)
  4. Outgoing Server: mail.domain.com (SMTP Port: 465)
  5.  
  6. MailDefinition md = new MailDefinition();
  7. md.From = "noreply@domain.com";
  8. md.IsBodyHtml = true;
  9. md.Subject = "subject";
  10.  
  11. MailMessage mm = md.CreateMailMessage("user1@gmail.com", null, "Some Text", new System.Web.UI.Control());
  12. mm.From = new MailAddress("noreply@domain.com", "System Name");
  13.  
  14. SmtpClient smtp = new SmtpClient();
  15. smtp.UseDefaultCredentials = false;
  16. smtp.Credentials = new NetworkCredential("noreply@domain.com", "password123");
  17. smtp.Host = "mail.domain.com";
  18. smtp.Port = 465; //tried for 25, 587
  19. smtp.EnableSsl = true;
  20. smtp.Timeout = 40000;
  21. smtp.Send(mm);
  22.  
  23. <system.net>
  24. <mailSettings>
  25. <smtp deliveryMethod="Network" from="noreply@domain.com">
  26. <network host="mail.domain.com" port="465" userName="noreply@domain.com" password="password123" defaultCredentials="false" enableSsl="true" />
  27. </smtp>
  28. </mailSettings>
  29. </system.net>
  30.  
  31. Port 25: Mailbox unavailable. The server response was: Error458 block
  32. Port 26: Mailbox unavailable. The server response was: Error458 block
  33. Port 465: The operation has timed out
  34. Port 587: Mailbox unavailable. The server response was: Error458 block
Add Comment
Please, Sign In to add comment