473,379 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

The SMTP server requires a secure connection or the client was not authenticated.

i write code for sending mail to client's given email addresses.

But Im getting following error message

The SMTP server requires a secure connection or the client was not authenticated. The server response was: dnsgem.org ESMTP MailEnable Service, Version: 0--2.53 denied access at 09/30/09 08:49:39


this is the code i written for sending mail

Expand|Select|Wrap|Line Numbers
  1.     Public Sub SendMail(ByVal Efrom As String, ByVal EReceiver As String, ByVal subject As String, ByVal body As String, ByVal attachmentFileName As String)
  2.  
  3.  Try
  4.  
  5.             Dim ToAddress As String
  6.  
  7.             ToAddress = "kitsinda@gmail.com"
  8.  
  9.             Dim Msg1 As New MailMessage(Efrom, ToAddress)
  10.             Msg1.Subject = subject
  11.             Msg1.Body = body
  12.             Msg1.Priority = MailPriority.Normal
  13.             Msg1.IsBodyHtml = True
  14.  
  15.             If (attachmentFileName <> "") Then
  16.                 Msg1.Attachments.Add(New Attachment(attachmentFileName))
  17.             End If
  18.  
  19.             Dim client1 As New SmtpClient(SMTPSERVER, 25)
  20.             client1.Credentials = New System.Net.NetworkCredential(Me.MailUsername, Me.MailPassword)
  21.             client1.Send(Msg1)
  22.  Catch ex As SmtpException
  23.             Throw New Exception(ex.Message)
  24.  
  25.         Finally
  26.  
  27.         End Try
  28.  
  29. End Sub
  30.  
  31.  
I don't know where i made mistake.

this is the url for

http://kitseducation.net/innerpages/enquiry.aspx,

Please give me solution for the above problem

Thanks In Advance.
Sep 30 '09 #1
7 8499
Frinavale
9,735 Expert Mod 8TB
You need to contact the company hosting the SMTP server and find out what port to connect on.

Right now you're connecting on the default port (25) but from my experience secured SMTP servers don't use this port.

-Frinny
Oct 1 '09 #2
blck
4
Hi praveenb000,

I also have the problem. Do you solved? Can you help me.
Feb 2 '12 #3
PsychoCoder
465 Expert Mod 256MB
You need to use the proper port (looks like you're sending it to GMail) so add this to your SmtpClient:

Expand|Select|Wrap|Line Numbers
  1. Dim client1 As new SmtpClient("smtp.gmail.com");
  2. client1.Port = 587;
  3. client1.Credentials = new System.Net.NetworkCredential("myaccount@gmail.com", "mypass");
  4. client1.EnableSsl = true;
  5.  
Feb 3 '12 #4
Frinavale
9,735 Expert Mod 8TB
I included a code snippet for how to send an email through gmail in the Quick reference on how to send an email using .NET article.

:)

-Frinny
Feb 3 '12 #5
blck
4
Hi,

I tried however it aslo display error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: host5.vdconline.vn ESMTP MailEnable Service, Version: 5.51-- denied access at 02/04/12 04:08:41

My code:
Expand|Select|Wrap|Line Numbers
  1. MailMessage msg = new MailMessage();
  2.         SmtpClient smtp = new SmtpClient("*.*.*.*", 25);        
  3.         msg.From = new MailAddress("admin@***");        
  4.         msg.To.Add(new MailAddress(TextBox1.Text));
  5.         msg.Subject = "Recover password";
  6.         msg.Body = "";
  7.         msg.IsBodyHtml = true;        
  8.  
  9.         smtp.DeliveryMethod = SmtpDeliveryMethod.Network;        
  10.  
  11.         smtp.EnableSsl = true;  
  12.  
  13.         smtp.UseDefaultCredentials = false;
  14.         smtp.Credentials = new NetworkCredential("admin@***", "*****");              
  15. try
  16.         {
  17.             smtp.Send(msg);
  18.             Label3.Text = "Email sent successfully";
  19.         }
  20.         catch (Exception ex)
  21.         {
  22.             Label3.Text = ""+ex.Message;
  23.         }
  24.  
Please help me!
Thanks in advance!
Feb 3 '12 #6
PsychoCoder
465 Expert Mod 256MB
For starters you're still using port 25, GMail requires port 587. Given the last part of the error message it's saying you're using the wrong username/password combination.

Are you sending email through Gmail or a different host?
Feb 3 '12 #7
blck
4
Hi,

I checked all info. Username and password of my webmail are correct.
I rented a host. Port outgoing of host is 25.
Particularly, before hosting, I sended email from this host to my gmail by control from my computer. It is successful. However, after hosting, it has error. I don't understand.
Alternatively, I sended email through gmail. It is successful.

Please help me! Thanks.
Feb 4 '12 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: David Hughes | last post by:
I wonder if anyone can help me resolve this problem. Although my ISP (One and One) provides the facility to run Python 2.2 CGI programs, their technical support people don't seem to have any Python...
2
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...
3
by: paulo | last post by:
Hello, I'm developing a web services apllication using SQL Server in mixed mode. I'm also using WSE 3.0. For each user in the application there's a corresponding user on the database. The...
4
by: jens Jensen | last post by:
Hello, I was given the task to build a .Net client that will talk to IBM integration server via HTTP post. The idea is that each http packet exchange should be authenticated via X09 "client...
1
by: eblackmo | last post by:
I have a test network consisting of four servers running windows 2003 server R2 SP2. I have set up a domain which functioned correctly for about a day and a half until the other servers decided they...
1
by: Jeff | last post by:
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...
7
by: John Drako | last post by:
Currently, I run postfix on my own server to send message from my site (password requests, account activation notices and other messages). I have phpMailer on the server and all the messages...
1
by: creative1 | last post by:
I am trying to setup contactus page. and testing it to work throug localhostI. I ahve setup everything php.ini and even tred to use following to make sure that everything is ok: ...
4
by: Brian | last post by:
Hello all, we don't actually host our own server but still should work the same. Here is the error message i get "error mailbox unavailable. The server response was: must be authenticated code...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.