J
Jim in Arizona
I was trying to have an email sent when the page loads but having some
trouble with it.
Our server is an IIS 6.0 with Framework 2.0. It is set to windows
authentication (not anonymous).
I don't really know what I'm doing and so far my tests haven't been so good.
Here's the code I tried:
Dim test As New System.Net.Mail.SmtpClient
test.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
test.UseDefaultCredentials = True
test.Host = "mailserver"
test.Send("Jim Morrison", "(e-mail address removed)", "Test Sub", "Test
Body")
The error message I get is:
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 16: test.UseDefaultCredentials = True
Line 17: test.Host = "exfs"
Line 18: test.Send("Jim Morrison", "(e-mail address removed)",
"Test Sub", "Test Body")
Line 19:
Line 20: End Sub
Source File: c:\inetpub\wwwroot\tests\winauth1.aspx.vb Line: 18
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) +872611
System.Net.Mail.MailAddress.ParseValue(String address) +245
System.Net.Mail.MailAddress..ctor(String address, String displayName,
Encoding displayNameEncoding) +87
System.Net.Mail.Message..ctor(String from, String to) +127
System.Net.Mail.MailMessage..ctor(String from, String to) +117
System.Net.Mail.SmtpClient.Send(String from, String recipients, String
subject, String body) +31
tests_winauth1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\tests\winauth1.aspx.vb:18
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
TIA,
Jim
trouble with it.
Our server is an IIS 6.0 with Framework 2.0. It is set to windows
authentication (not anonymous).
I don't really know what I'm doing and so far my tests haven't been so good.
Here's the code I tried:
Dim test As New System.Net.Mail.SmtpClient
test.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
test.UseDefaultCredentials = True
test.Host = "mailserver"
test.Send("Jim Morrison", "(e-mail address removed)", "Test Sub", "Test
Body")
The error message I get is:
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 16: test.UseDefaultCredentials = True
Line 17: test.Host = "exfs"
Line 18: test.Send("Jim Morrison", "(e-mail address removed)",
"Test Sub", "Test Body")
Line 19:
Line 20: End Sub
Source File: c:\inetpub\wwwroot\tests\winauth1.aspx.vb Line: 18
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) +872611
System.Net.Mail.MailAddress.ParseValue(String address) +245
System.Net.Mail.MailAddress..ctor(String address, String displayName,
Encoding displayNameEncoding) +87
System.Net.Mail.Message..ctor(String from, String to) +127
System.Net.Mail.MailMessage..ctor(String from, String to) +117
System.Net.Mail.SmtpClient.Send(String from, String recipients, String
subject, String body) +31
tests_winauth1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\tests\winauth1.aspx.vb:18
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42
TIA,
Jim