G
Guest
I tried out the new System.Net.Mail.SmtpClient feature of asp.net 2.0 and I
love it, but there's just one problem. When it sends an email out, it sends
to BOTH the TO and the FROM address. I have the following code which is very
simple.
------------------------snip----------------------------------
Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
lsEmailSubj = "test1"
lsEmailBody = "test2"
Dim msgmail As New
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)", lsEmailSubj, lsEmailBody)
client.Send(msgmail)
--------------------------------------------------------------
This is the only part of my code that actually sends out the email and the
TO and FROM are hardcoded as you can see. However, TWO emails get sent out.
One is from globalitreporting, to user1 .. and... then it sends out the
second email FROM globalitreporting TO globalitreporting.
The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
the time. Is there something about the SmtpClient class that I am forgetting
or is there some setting on my SMTP server that might be messing this up?
Does anyone have any ideas?
->Brian Lorraine
love it, but there's just one problem. When it sends an email out, it sends
to BOTH the TO and the FROM address. I have the following code which is very
simple.
------------------------snip----------------------------------
Dim client = New System.Net.Mail.SmtpClient("mail.mydomain.net")
client.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
lsEmailSubj = "test1"
lsEmailBody = "test2"
Dim msgmail As New
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)", lsEmailSubj, lsEmailBody)
client.Send(msgmail)
--------------------------------------------------------------
This is the only part of my code that actually sends out the email and the
TO and FROM are hardcoded as you can see. However, TWO emails get sent out.
One is from globalitreporting, to user1 .. and... then it sends out the
second email FROM globalitreporting TO globalitreporting.
The really strange thing is that this only happens SOMETIMES, maybe 1/3 of
the time. Is there something about the SmtpClient class that I am forgetting
or is there some setting on my SMTP server that might be messing this up?
Does anyone have any ideas?
->Brian Lorraine