Solved

SMTP authentication is required' When IIS configured to send via localhost

Posted on 2011-09-16
5
411 Views
Last Modified: 2012-06-27
Hi All,

I am using the attached mailing script and configured IIS for this domain to use localhost to send email but still get the error:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: SMTP authentication is required.

Now I don't know if this error is caused by my code or whether its an IIS settign that I have overklooked.

Could you provide any suggestions?

Thanks,

Rit

WEB.CONFIG
<system.net>
        <mailSettings>
            <smtp deliveryMethod="Network">
                <network host="127.0.0.1" port="25" defaultCredentials="false" />
            </smtp>


EMAIL FUNCTION


public static void SendHTMLMessage(string strEmailTemplate, string strSubject, string strFromAddress, string strFromAlias, string strToAddress)
    {
        SmtpClient mySmtpClient = new SmtpClient();
        MailAddress from = new MailAddress(strFromAddress, strFromAlias);
        MailAddress to = new MailAddress(strToAddress);
        MailMessage message = new MailMessage(from, to);
        message.BodyEncoding = Encoding.ASCII;
        message.IsBodyHtml = true;
        message.Subject = strSubject;
        message.Body = strEmailTemplate;
        mySmtpClient.Send(message);
    }

        </mailSettings>
    </system.net>

Open in new window

0
Comment
Question by:rito1
  • 2
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
gaurav05 earned 250 total points
ID: 36547953
Hi,

<system.net>
   <mailSettings>
      <smtp from="someaddress@myCTdomain.com">
         <network host="mail.myCTdomain.com" password="xxxxxx" port="25" userName="someaddress@myCTdomain.com"/>
      </smtp>
   </mailSettings>
</system.net>
0
 
LVL 1

Author Comment

by:rito1
ID: 36547973
Hi

From what I understand talking with our hosts, the server has been configured as an SMTP server and it doesn't need to be authenticated as emails can only be sent  from the server.

Rit
0
 
LVL 10

Expert Comment

by:gaurav05
ID: 36547998
hi,

you need to put smtp servers ip address in relay list and in connection control of SMTP server.

0
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 250 total points
ID: 36548045

Refer: http://www.systemwebmail.com/faq/3.8.aspx

SmtpMail.SmptServer = "ipaddress"
SmtpMail.Send(mailmsg);



0
 
LVL 1

Author Closing Comment

by:rito1
ID: 36548830
Hi All,

It turns out that the SMTP server uses port 26 instad of 25!

Thanks for you help anyway.

Rit
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now