Connecting Tech Pros Worldwide Help | Site Map

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

Newbie
 
Join Date: Aug 2008
Posts: 17
#1: Sep 30 '09
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.
Frinavale's Avatar
Site Moderator
 
Join Date: Oct 2006
Location: The Great White North
Posts: 5,066
#2: Oct 1 '09

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


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
Reply