i m trying to send mail from vbnet it shows error:
Server Error in '/' Application.
Server does not support secure connections.
Description: An unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: Server does not support secure connections.
code:
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New _
Net.NetworkCredential("test@iqds.com", "experien")
SmtpServer.Port = 25
SmtpServer.EnableSsl = "true"
SmtpServer.Host = "mail.iqds.com"
Dim mail As New MailMessage()
mail = New MailMessage()
mail.To.Add(Email)
mail.From = New MailAddress("test@iqds.com")
mail.Body = "Registered Successfully"
' mail.Body += "successfully"
mail.Subject = "register"
i think your smpt server not support this connection please try your code wiht gmail smtp server and use gamil email accout for sending email and setSmtpServer.EnableSsl="false"
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New _
Net.NetworkCredential("username@gmail.com", "password")
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
mail = New MailMessage()
mail.From = New MailAddress("YOURusername@gmail.com")
mail.To.Add("TOADDRESS")
mail.Subject = "Test Mail"
mail.Body = "This is for testing SMTP mail from GMAIL"
SmtpServer.Send(mail)
MsgBox("mail send")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
i m able to send mail through gmail but from from my website
i removed enable.ssl="false"
but its working on local machine when i upload on webite shows error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review
the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Imports System.Web.Mail
Sub Main()
Dim strMSG As String
Dim strArgs() As String = Command.Split(",")
Dim blnSMTP As Boolean = False
Dim blnCC As Boolean = False
Dim blnAttachments As Boolean = False
Try
Dim insMail As New MailMessage()
With insMail
.From = Trim(strArgs(0))
.To = Trim(strArgs(1))
.Subject = Trim(strArgs(2))
.Body = Trim(strArgs(3))
If blnCC Then .Cc = Trim(strArgs(5))
If blnAttachments Then
Dim strFile As String
Dim strAttach() As String = Split(strArgs(6), ";")
For Each strFile In strAttach
.Attachments.Add(New MailAttachment(Trim(strFile)))
Next
End If
End With
If blnSMTP Then SmtpMail.SmtpServer = Trim(strArgs(4))
SmtpMail.Send(insMail)
Console.WriteLine("Successfully sent email message" + vbCrLf)
Catch err As Exception
Console.WriteLine("EXCEPTION " + err.Message + vbCrLf)
End Try
End Sub
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
According to the description above, it seems like that you need to enable ssl on the IIS. For details, please check the link below:
Smadhu
Member
510 Points
989 Posts
sending mail error
Sep 20, 2012 06:10 AM|LINK
i m trying to send mail from vbnet it shows error:
Server Error in '/' Application.
Server does not support secure connections.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: Server does not support secure connections.
code:
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New _
Net.NetworkCredential("test@iqds.com", "experien")
SmtpServer.Port = 25
SmtpServer.EnableSsl = "true"
SmtpServer.Host = "mail.iqds.com"
Dim mail As New MailMessage()
mail = New MailMessage()
mail.To.Add(Email)
mail.From = New MailAddress("test@iqds.com")
mail.Body = "Registered Successfully"
' mail.Body += "successfully"
mail.Subject = "register"
SmtpServer.Send(mail)
SuccessDisplay.Text = "Added Successfully"
plz suggest
thnx
dhol.gaurav
Contributor
3998 Points
725 Posts
Re: sending mail error
Sep 20, 2012 06:54 AM|LINK
Hello,
Change SSL Enable to false, this error generate becouse your smtp is not supported to secure connection.
let me know if any query
Gaurav Dhol
Skype ID : dhol.gaurav
If My Post contains helped you, Please Mark as Answer
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: sending mail error
Sep 20, 2012 06:55 AM|LINK
i think your smpt server not support this connection please try your code wiht gmail smtp server and use gamil email accout for sending email and set SmtpServer.EnableSsl = "false"
Imports System.Net.Mail Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Try Dim SmtpServer As New SmtpClient() Dim mail As New MailMessage() SmtpServer.Credentials = New _ Net.NetworkCredential("username@gmail.com", "password") SmtpServer.Port = 587 SmtpServer.Host = "smtp.gmail.com" mail = New MailMessage() mail.From = New MailAddress("YOURusername@gmail.com") mail.To.Add("TOADDRESS") mail.Subject = "Test Mail" mail.Body = "This is for testing SMTP mail from GMAIL" SmtpServer.Send(mail) MsgBox("mail send") Catch ex As Exception MsgBox(ex.ToString) End Try End Sub End ClassSohail Shaikh
Smadhu
Member
510 Points
989 Posts
Re: sending mail error
Sep 20, 2012 06:58 AM|LINK
i m able to send mail through gmail but from from my website
i removed enable.ssl="false"
but its working on local machine when i upload on webite shows error
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. Learn more at
SohailShaikh
Contributor
6129 Points
1172 Posts
Re: sending mail error
Sep 20, 2012 07:46 AM|LINK
Check this thread this prblem also discuss on serval times
http://forums.asp.net/p/1327338/3667481.aspx
Sohail Shaikh
msomar
Participant
843 Points
390 Posts
Re: sending mail error
Sep 20, 2012 08:02 AM|LINK
http://vb.net-informations.com/communications/vb.net_smtp_mail.htm
http://www.a1vbcode.com/snippet-3384.asp
Imports System.Web.Mail Sub Main() Dim strMSG As String Dim strArgs() As String = Command.Split(",") Dim blnSMTP As Boolean = False Dim blnCC As Boolean = False Dim blnAttachments As Boolean = False Try Dim insMail As New MailMessage() With insMail .From = Trim(strArgs(0)) .To = Trim(strArgs(1)) .Subject = Trim(strArgs(2)) .Body = Trim(strArgs(3)) If blnCC Then .Cc = Trim(strArgs(5)) If blnAttachments Then Dim strFile As String Dim strAttach() As String = Split(strArgs(6), ";") For Each strFile In strAttach .Attachments.Add(New MailAttachment(Trim(strFile))) Next End If End With If blnSMTP Then SmtpMail.SmtpServer = Trim(strArgs(4)) SmtpMail.Send(insMail) Console.WriteLine("Successfully sent email message" + vbCrLf) Catch err As Exception Console.WriteLine("EXCEPTION " + err.Message + vbCrLf) End Try End Subgeniusvishal
Star
14306 Points
2820 Posts
Re: sending mail error
Sep 20, 2012 08:39 AM|LINK
On the Servers tab of your POP client, enable My server requires authentication beneath Outgoing Mail Server.
Refer:
http://www.emailquestions.com/gmail/208-read-gmail-any-mail-program.html
My Website
www.dotnetvishal.com
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: sending mail error
Sep 21, 2012 03:13 AM|LINK
Hi,
According to the description above, it seems like that you need to enable ssl on the IIS. For details, please check the link below:
http://weblogs.asp.net/scottgu/archive/2007/04/06/tip-trick-enabling-ssl-on-iis7-using-self-signed-certificates.aspx
In addition, you can check the similar thread below:
http://stackoverflow.com/questions/704636/sending-email-through-gmail-smtp-server-with-c-sharp
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store
teguhyuliant...
Participant
1370 Points
372 Posts
Re: sending mail error
Sep 21, 2012 07:12 AM|LINK
Also, you can solve your problem refer this link below :
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/c3bf6d0a-f93d-4d53-9661-5f44094d9161/
Rama Srinu A
Member
24 Points
7 Posts
Re: sending mail error
Sep 21, 2012 07:53 AM|LINK
use web.config to store SMTP settings , so u can change while deploying web app in server.check below link
http://www.4guysfromrolla.com/articles/072606-1.aspx
sample:
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod=”network”>
<network host="localhost"
port="25"
enableSsl="true"
defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
</configuration>