Unable to send mail (Mail Relay error), have all settings in SMTP Mail Server
NickName:Incredible Ask DateTime:2013-09-24T20:47:20

Unable to send mail (Mail Relay error), have all settings in SMTP Mail Server

I have done all the setting, I tried hit and trial, specified IP etc but still I am unable to send mail from my c# code (outside my domain, within its fine).

If I try to send mail by specifying credentials in web config, then I am able to send mails outside my domain. But that is not I want.

When I try to send via my code, then I do the setting on the SMTP , allow relay and specify domain, that doesn't work.

I check the checkbox, which states that send mail to all address etc. That is also not working.

Where I am wrong?

My code:

When I specify in web config:

<system.net>
<mailSettings>
  <smtp deliveryMethod="Network" from="[email protected]">
    <network enableSsl="false" host="hostname" port="25" userName="abc" password="abc#" defaultCredentials="false" clientDomain="domainname"/>
  </smtp>
</mailSettings>

When specifying through code:

using (smtp)
{
smtp.Host = "hostname";
smtp.UseDefaultCredentials = false;
smtp.Port = 25;
smtp.EnableSsl = true;
smtp.Credentials = new System.Net.NetworkCredential("[email protected]", "abc123#");
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
}

These settings in the server, but no success. enter image description here

Copyright Notice:Content Author:「Incredible」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18982041/unable-to-send-mail-mail-relay-error-have-all-settings-in-smtp-mail-server

More about “Unable to send mail (Mail Relay error), have all settings in SMTP Mail Server” related questions

Unable to send mail (Mail Relay error), have all settings in SMTP Mail Server

I have done all the setting, I tried hit and trial, specified IP etc but still I am unable to send mail from my c# code (outside my domain, within its fine). If I try to send mail by specifying

Show Detail

Configure SMTP Server to send mail

I have deployed a website (ASP.Net/C#) on my windows server 2012 R2 (it's a VPS and I installed IIS and SMTP), and everything works fine except one thing: I CANNOT send mail through my website! I

Show Detail

Mail function - change SMTP relay

I use PHP's mail function to send emails from my server, which currently also handles mail. However, I would like PHP to start sending messages through a different SMTP relay, not the server it's r...

Show Detail

How to send mail with SMTP relay?

I am trying to send email using SMTP relay as mentioned in this article Option 3. I have done every step as said in the article but I am not sure how to send mail after the step-up is done. Can som...

Show Detail

SMTP Mail Sending Issue : com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay

I am trying to send mail from Java. If i will send mail to same SMTP it working fine. If i will send mail to outside SMTP means like Gmail, Yahoo etc. it'as shows error like, [com.sun.mail.smtp.

Show Detail

PHP mail() relay to mail server

I noticed a couple other posts around that were similar to my problem but found that they weren't specific to my scenario or I am just not understanding things very well. My situation: I am tryin...

Show Detail

Send mail via google app with smtp relay

My application in asp.net with c#, from application some notification email sent daily (more then 500). We have change mail hosting to Google mail app. For sending mail I was using smtp host “smtp....

Show Detail

Unable to send Mail using smtp relay, Ruby mail gem

I'm trying to send an email using the 'mail' gem (packaging using OCRA), but I'm getting an error message: === Loading script to check dependencies C:/Ruby23/lib/ruby/gems/2.3.0/gems/mail-2.6.6/lib/

Show Detail

Setting up mail smtp relay service to send and receive mail

I have very limited knowledge about SMTP and IMAP/POP. SMTP --&gt; sending message, IMAP--&gt; Mainly for receiving messages. I have a woocommerce website and i already did setup my email system to...

Show Detail

SMTP mail errors

I am developing a C# application to send mail using the SMTP server of our company mail. The following is the code. MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("10...

Show Detail