Hi there,
I have a unmanaged VPS server running Windows Server 2008 r2. Right now I am configuring SMTP feature under IIS6 and set up a SMTP server. I configured DNS record as follow:
a | @ | My IP Address | 600 seconds | Edit |
a | My IP Address | 600 seconds | Edit | |
a | mssql | My IP Address | 600 seconds | Edit |
cname | ftp | @ | 1 Hour | Edit |
cname | smtp | mail.mydomain.com | 1 Hour | Edit |
cname | www | @ | 1 Hour | Edit |
cname | _domainconnect | _domainconnect.gd.domaincontrol.com | 1 Hour | Edit |
mx | @ | mail.mydomain.com (Priority: 10) | 1 Hour | Edit |
srv | _autodiscover._tcp.@ | 0 0 443 autodiscover.secureserver.net | 1 Hour | Edit |
srv | _smtp._tcp.@ | 0 0 25 mail.mydomain.com | 1 Hour | Edit |
ns | @ | pdns07.domaincontrol.com | 1 Hour | |
ns | @ | pdns08.domaincontrol.com | 1 Hour |
And I have mail.mydomain.com as Fully Qualified Domain Name under SMTP server properties, Used my IP address and port 25. I also set access control and outbound security to anonymous, connection control and relay restrictions are only given to 127.0.0.1.
But I tried SMTPdiag to test SMTP connection and it fails to connect the destination smtp server as follow:
PS C:\smtpdiag> ./smtpdiag example@mydomain.com myemail@gmail.com
Searching for Exchange external DNS settings.
Computer name is Somethin.
Failed to connect to the domain controller. Error: 8007054b
Checking SOA for gmail.com.
Checking external DNS servers.
Checking internal DNS servers.
SOA serial number match: Passed.
Checking local domain records.
Checking MX records using TCP: mydomain.com.
Checking MX records using UDP: mydomain.com.
Both TCP and UDP queries succeeded. Local DNS test passed.
Checking remote domain records.
Checking MX records using TCP: gmail.com.
Checking MX records using UDP: gmail.com.
Both TCP and UDP queries succeeded. Remote DNS test passed.
Checking MX servers listed for something@gmail.com
Connecting to gmail-smtp-in.l.google.com [74.125.28.27] on port 25.
Connecting to the server failed. Error: 10060
Failed to submit mail to gmail-smtp-in.l.google.com.
Connecting to alt1.gmail-smtp-in.l.google.com [74.125.132.26] on port 25.
Connecting to the server failed. Error: 10060
Failed to submit mail to alt1.gmail-smtp-in.l.google.com.
Connecting to alt2.gmail-smtp-in.l.google.com [173.194.219.27] on port 25.
Connecting to the server failed. Error: 10060
Failed to submit mail to alt2.gmail-smtp-in.l.google.com.
Connecting to alt3.gmail-smtp-in.l.google.com [173.194.68.27] on port 25.
Connecting to the server failed. Error: 10060
Failed to submit mail to alt3.gmail-smtp-in.l.google.com.
Connecting to alt4.gmail-smtp-in.l.google.com [173.194.210.26] on port 25.
Connecting to the server failed. Error: 10060
Failed to submit mail to alt4.gmail-smtp-in.l.google.com.
I am wondering what's wrong with the configuration and someone pleas can help me. Thank you for your time.
p.s. I am going to use php mail() function to send emails.
Solved! Go to Solution.
Hi @ngeforce, welcome to the community! 🙂
Can you check your relay domain?
Maybe it doesn't know where to forward the send request.
You can ask support from your server panel.
Hope it helps!
Hi @ngeforce, welcome to the community! 🙂
Can you check your relay domain?
Maybe it doesn't know where to forward the send request.
You can ask support from your server panel.
Hope it helps!
Hi @jpablo, support team told me server is not supporting direct smtp delivery and I have to use smtp relay server to deliver. Also, newer server is using dedrelay.secureserver.net as relay. It is working now. Thank you for your help.
I know this is already solved but there is a key piece of information here that may help someone in the future.
As ngeforce noted, the relay server is dedrelay.secureserver.net, NOT relay-hosting.secureserver.net as stated in GoDaddy's documentation (https://uk.godaddy.com/help/send-email-using-systemnetmail-19291). I'll lost quite a few hours testing all kinds of parameters trying to send emails from a VPS using ASP.Net and finally came across this alternate or newer relay server. Thanks ngeforce!
Here are the parameters I'm using and that are working for me in case anyone is trying to programmatically send emails.
In web.config:
<system.net>
<mailSettings>
<smtp from="noreply@domain.com">
<network host="dedrelay.secureserver.net" port="25" />
</smtp>
</mailSettings>
</system.net>
In Code (C#):
try
{
MailMessage message = new MailMessage();
message.From = new MailAddress("noreply@domain.com");
message.To.Add(new MailAddress("recipient@domain.com"));
message.Subject = "My Email Subject";
message.Body = "Hello World!";
SmtpClient client = new SmtpClient();
client.EnableSsl = false;
client.Send(message);
}
catch(Exception ex)
{
lblMessage.Text = ex.ToString();
}
finally
{
}