473,857 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SMTP Mail Error - Requires Client Authentication

I am receiving the following error:

// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.

How do I provide the Client Authentication with the code below.
private void SendEmail2()
{
/* create the email message */
MailMessage message = new mailMessage("jw ***@domain.com" ,
"te**@domain.co m","Test email " +
DateTime.Today. ToString(),"bod y fo the message " );

/* create SMTP Client and add credentials */
SmtpClient smtpClient = new SmtpClient("smt p.domain.com");

/* Email with Authentication */
smtpClient.Cred entials = new NetworkCredenti al("jwill",
"abcdef");
smtpClient.UseD efaultCredentia ls = false;
/*Send the message */
smtpClient.Send (message);

// error: System.Net.Mail .SmtpException: The SMTP server requires a
secure connection or the client was not authenticated. The server
response was: 5.7.0 No AUTH command has been given.
}
Feb 26 '08 #1
1 14366
Go here
http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!138.entry

download the code..and you can tweak the settings as needed....


"Jeff" <jeff@[_nospam_].hardsoft.com.a uwrote in message
news:13******** *****@corp.supe rnews.com...
>I am receiving the following error:

// error: System.Net.Mail .SmtpException: The SMTP server requires a secure
connection or the client was not authenticated. The server response was:
5.7.0 No AUTH command has been given.

How do I provide the Client Authentication with the code below.
private void SendEmail2()
{
/* create the email message */
MailMessage message = new mailMessage("jw ***@domain.com" ,
"te**@domain.co m","Test email " + DateTime.Today. ToString(),"bod y fo
the message " );

/* create SMTP Client and add credentials */
SmtpClient smtpClient = new SmtpClient("smt p.domain.com");

/* Email with Authentication */
smtpClient.Cred entials = new NetworkCredenti al("jwill",
"abcdef");
smtpClient.UseD efaultCredentia ls = false;
/*Send the message */
smtpClient.Send (message);

// error: System.Net.Mail .SmtpException: The SMTP server requires a secure
connection or the client was not authenticated. The server response was:
5.7.0 No AUTH command has been given.
}

Feb 26 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5595
by: dale zhang | last post by:
Hi, I write an asp.net web application. It has a “Contact Us” page, where users fill in their email, subject and text and hit send. Then the email will go to my hard coded yahoo email account. I was using optimum online service with smtp server as “mail.optonline.net”. I can receive email correctly. Now I switch to verizon DSL. I change my smtp server accordingly as
1
2374
by: Rodrigo | last post by:
I'm trying to send an email message using my SMTP server that requires authentication. How can I do that? My code is: Dim email As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage email.From = "me@mydomain.com.br" email.To = txtemail.Text email.Subject = "We have receveid your comments" email.BodyFormat = System.Web.Mail.MailFormat.Html email.Body ="<html>" & _
1
1191
by: anony | last post by:
Hi, I'm trying to use system.web.mail to send an email, but the smtp server requires authentication. I cam across some info about extra fields allowed via the following: Dim mail As New MailMessage() mail.To = "to@address.com mail.From = "from@address.com" mail.Subject = "this is a test email."
5
8798
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address with this code: MailMessage msgMail = new MailMessage(); msgMail.To = "test@address.com"; msgMail.From = "from@address.com"; msgMail.Subject = "Mail Example Subject";
2
2449
by: T.Archer | last post by:
The host a client wants to use requires authentication to relay messages. How do I set the authentication (username/password) before using the smtpmail.send(mailmessage) method? Surely this must be a common thing to do. I have been utterly unable to google an answer. --Tony Archer
12
2613
by: copyco | last post by:
I'm trying to write code that will send an e-mail using WinSock. Problem is that my server requires my password for outgoing e-mail. What is the SMTP format for supplying the password to the server?? I've checked out http://www.faqs.org/rfcs/rfc821.html but there is absoulutely nothing concerning authentication. Any help appreciated.
7
7757
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee free edition for anti-virus. I use an ISP provider from my country and according to them I do not need to perform authentication while sending mails through their SMTP address. Thus I am using external SMTP server. I don't have IIS installed...
4
2994
by: eruth | last post by:
Hi all, I'm trying to send an e-mail from a vb.net web form. I can create the message, but when it comes to actually sending it I get the following error. "Mailbox name not allowed. The server response was: Server policy dictates you must authenticate first " So far as I can tell, my code is doing what it's meant to, but I'd appreciate someone casting an eye over it to make sure. This is based on a couple of examples found through...
6
5207
by: phpmagesh | last post by:
Hi, I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details, problem is when i send mail it simple through waring msg as: can anyone help me why such problem occurs, how to over come this problem.
0
9767
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11082
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10711
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10394
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5967
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4592
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.