D
daokfella
I'm having trouble using localhost to test the e-mail functions in my
application. I keep getting the following error when sending mail:
"Unable to read data from the transport connection: An existing
connection was forcibly closed by the remote host."
This is what I have in my config:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network host="localhost" password="" userName="" port="25"
defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
This is my code to send mail:
Dim msg As New System.Net.Mail.MailMessage(_from, _to,
_subject, _body)
msg.IsBodyHtml = True
Dim client As New Net.Mail.SmtpClient
client.Send(msg)
I get the error on the Send method. Anybody have any ideas? I'm
guessing is something to do with IIS. I had no problems with
System.Web.Mail, but I'm trying to use the new System.Net.Mail in my
2.0 app without any luck.
I was able to get things working using an SMTP server other than my
localhost as long as I was sending mail to the same domain. I couldn't
quite figure out the credentials part yet, so I thought I'd stick with
localhost for the time being. Any ideas?
Thanks,
Jason
application. I keep getting the following error when sending mail:
"Unable to read data from the transport connection: An existing
connection was forcibly closed by the remote host."
This is what I have in my config:
<system.net>
<mailSettings>
<smtp from="(e-mail address removed)">
<network host="localhost" password="" userName="" port="25"
defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>
This is my code to send mail:
Dim msg As New System.Net.Mail.MailMessage(_from, _to,
_subject, _body)
msg.IsBodyHtml = True
Dim client As New Net.Mail.SmtpClient
client.Send(msg)
I get the error on the Send method. Anybody have any ideas? I'm
guessing is something to do with IIS. I had no problems with
System.Web.Mail, but I'm trying to use the new System.Net.Mail in my
2.0 app without any luck.
I was able to get things working using an SMTP server other than my
localhost as long as I was sending mail to the same domain. I couldn't
quite figure out the credentials part yet, so I thought I'd stick with
localhost for the time being. Any ideas?
Thanks,
Jason