Resolved -- problem like gmail etc think that the email is sent as spam. -- mail error

Topics: Help
Jan 17, 2008 at 6:28 AM
When I update the Web content data I get the that is below (it does update the database)

When I run debug in visual I get
FormatException was unhandled by user code The specified string is not in the form required fo an e-mail address
The section of code in cms.vb
Dim mail As New System.Net.Mail.MailMessage


In debug mode
The specified string is not in the form required for an e-mail address.
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.FormatException: The specified string is not in the form required for an e-mail address.

Source Error:


Line 38:
Line 39: Public Shared Sub ReportUpdate(ByVal OrigionalContent As String, ByVal NewContent As String, ByVal sectionname As String, ByVal IPAddress As String)
Line 40: Dim mail As New System.Net.Mail.MailMessage
Line 41:
Line 42: mail.To.Add(ClubStarterKit.Web.Settings.Webmaster())


Source File: c:\Inetpub\vhosts\balsabashers.com\httpdocs\App_Code\BLL\CMS.vb Line: 40

Stack Trace:


FormatException: The specified string is not in the form required for an e-mail address.
System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName) +934335
System.Net.Mail.MailAddress.ParseValue(String address) +245
System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding) +87
System.Net.Mail.MailMessage..ctor() +271
ClubStarterKit.Web.CMS.ReportUpdate(String OrigionalContent, String NewContent, String sectionname, String IPAddress) in c:\Inetpub\vhosts\balsabashers.com\httpdocs\App_Code\BLL\CMS.vb:40
ASP.webcontenteditoraspx.Button1_Click(Object sender, EventArgs e) in c:\Inetpub\vhosts\balsabashers.com\httpdocs\WebContent\Editor.aspx:53
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746


Jan 17, 2008 at 6:32 AM
Edited Jan 17, 2008 at 6:36 AM
When I go to send an email to administrators I get this error
Line 80
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first d24sm2846329and.12
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.7.0 Must issue a STARTTLS command first d24sm2846329and.12

Source Error:


Line 78: smtp.UseDefaultCredentials = False
Line 79: smtp.Credentials = a
Line 80: smtp.Send(msgMail)
Line 81: Response.Redirect("~/default.aspx")
Line 82: End Sub


Source File: c:\Inetpub\vhosts\balsabashers.com\httpdocs\Admin\Email.aspx.vb Line: 80

Stack Trace:


SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first d24sm2846329and.12
System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response) +881192
System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from) +39
System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception) +95
System.Net.Mail.SmtpClient.Send(MailMessage message) +2004
AdminEmail.btnSendClick(Object sender, EventArgs e) in c:\Inetpub\vhosts\balsabashers.com\httpdocs\Admin\Email.aspx.vb:80
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746



Jan 17, 2008 at 6:33 AM
Edited Jan 17, 2008 at 6:34 AM
My web.config looks like this

<system.net>
<mailSettings>
<smtp from="mail.balsabashers.com">
<network host="mail.balsabashers.com" password="xxxxxxxx" userName=" xxxxxxx@balsabashers.com"/>
</smtp>
</mailSettings>
Jan 20, 2008 at 1:30 AM
One main question is do I edit the web.config as above?
second question is and also add in the site setup?

How to get around spam selection then??
Jan 20, 2008 at 1:58 AM
Ok, The web config stays the same. No changes.
Edit the site setup.
The problem is the sites like gmail etc think that the email is sent as spam. How do we change that??
Jan 20, 2008 at 2:54 AM
I think it was my hosting site.
Thank you for the views.
JIm