Click here to Skip to main content
15,894,539 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have configured with smtp mail server with our domain but its showing error that..\

Service not available, closing transmission channel. The server response was: 4.3.2 Service not available

please let me know soon what the problem there
Posted
Comments
Try some answers from Google[^].
Nelek 9-Nov-13 7:46am    
There are thousands of ways to screw things up, how are we supposed to know which one did you choose?
I recommend you to read:
How to ask a question[^] and What have you tried?[^]

1 solution

Set this on your web config file
XML
<system.net>
		<mailsettings>
			<smtp from="notifications@yourwebsite.com">
				<network host="yourwebsite.com" password="1@Password" username="notifications@yourwebsite.com" port="587" />
			</smtp>
		</mailsettings>
</system.net>



Remember to use the following namespace
XML
using System.Net;
using System.Net.Mail;

 public static bool SendEmail(string to, string cc, string msgsubject, string msgbody)
    {
        try
        {
            MailMessage msg = new MailMessage();
            msg.From = new MailAddress("notifications@yourwebsite.com", "Testing Server");
            msg.To.Add(new MailAddress(to));
            msg.CC.Add(new MailAddress(cc));

            msg.IsBodyHtml = true;
            msg.Subject = msgsubject;
            msg.Body = msgbody;

            SmtpClient mSmtpClient = new SmtpClient();
            mSmtpClient.EnableSsl = false;
            mSmtpClient.Send(msg);

            return true;

        }
        catch (Exception emsg)
        {
            throw emsg;
        }
        return false;


    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900