Sending emails out from ASP.NET

Arash

New Member
Hi,

Has anyone managed to get sending of emails out from your website on Interserver working with ASP.NET?

I've tried System.Net.Mail.MailMessage and System.Web.Mail.MailMessage and neither work.
I'm a .NET developer so I know my way round this topic and I have managed to get this to work on other hosters.

Interserver's solution is the obsolete and outdated CDO.Message!!

I'm pretty sure it's there internal SMTP configuration which is the issue but I wanted to check to see if anyone else has managed to get this to work.

This is the code - more or less:

SmtpClient smtpClient = new SmtpClient("216.158.229.34", 25);
MailMessage mail = new MailMessage();
//Setting From , To and CC
mail.From = new MailAddress("info@mydomain.com");
mail.To.Add(new MailAddress("info@mydomain.com"));
mail.Body ="test";
mail.Subject ="test";

smtpClient.Credentials = new System.Net.NetworkCredential("info@mydomain.com", "PASSWORD");
smtpClient.UseDefaultCredentials = false;
smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network;
smtpClient.EnableSsl = false;

smtpClient.Send(mail);

The support team have give me THREE different SMTP IPs that "SHOULD" work.

Anyone?

Thanks
 

Quags

Administrator
Staff member
Check the mx record for your domain name. It may be

plesk-mail.interserver.net or plesk-mail2.interserver.net

use this ip and not the server ip your site points to 216.158.229.34

You can use port 25, 587 or 465 (ssl only on 465)
 

Arash

New Member
The mx record is mail.MYDOMAIN.com which resolves to 67.211.213.69.
I've already tried this and on port 587 or 465, the process timeouts trying to connect to the smtp server.

On port 25 it comes back with:
"The remote certificate is invalid according to the validation procedure."

With plesk-mail.interserver.net I get this:
"Transaction failed. The server response was: 5.7.1 : Relay access denied"

With plesk-mail2.interserver.net: Operation times out connecting to the smtp server

The thing is, the same settings with 67.211.213.69 works if I try the code from my home PC which makes me think that my website just cannot connect to the smtp server!!

It all points to a misconfiguration on Interserver side of things!
 

Arash

New Member
If I use 127.0.0.1 as smtp server, I get NO errors and everything seems to work but the email is not actually sent or received !
 

chinigla

New Member
The mx record is mail.MYDOMAIN.com which resolves to 67.211.213.69.
I've already tried this and on port 587 or 465, the process timeouts trying to connect to the smtp server.

On port 25 it comes back with:
"The remote certificate is invalid according to the validation procedure."

With plesk-mail.interserver.net I get this:
"Transaction failed. The server response was: 5.7.1 : Relay access denied"

With plesk-mail2.interserver.net: Operation times out connecting to the smtp server

The thing is, the same settings with 67.211.213.69 works if I try the code from my home PC which makes me think that my website just cannot connect to the smtp server!!

It all points to a misconfiguration on Interserver side of things!
Did you ever get a resolve for this? Just started up with Interserver today and ran into trouble as well.
 

Quags

Administrator
Staff member
When this post was made plesk was running plesk automation with a separate email and mysql and mssql set up. Now plesk onyx is used. Based on your server hostname (which is in the format of pleskXXXX.is.cc) connect to the mail server that is the plesk hostname. Port 25, 465 or 587 are available. localhost or 127.0.0.1 might actually work now when in the past it did not.
 
Top