i put the ipaddress of the webserver in the network host & my IIS is already set to (All unassigned)...but still there is an error
is there anything to configure in my Default SMTP Virtual Server (IIS)?
I have seen a code like this
Dim msgMail As New System.Net.Mail.MailMessage
Dim emailFromAddress As New System.Net.Mail.MailAddress(emailFrom)
Dim emailToAddress As New System.Net.Mail.MailAddress(emailTo)
Dim SmtpClient As New System.Net.Mail.SmtpClient
msgMail.To(0) = emailToAddress
msgMail.From = emailFromAddress
msgMail.Subject = emailSubject
msgMail.IsBodyHtml = isBodyHTML
msgMail.Body = emailMessage
SmtpClient.Host = "ip address"
SmtpClient.Send(msgMail)
the problem is, it can only send emails thru our intranet emails, but if i want it to send to yahoo/hotmail, it doesnt send
You can also check out an article that I have published that explains the differences from ASP.NET 1.x and ASP.NET 2.0. You can get the article here: http://aspalliance.com/962
Jason N. Gaylord
ASPInsider and Microsoft MVP
http://jasongaylord.com
Ez416
Participant
1088 Points
607 Posts
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 06:44 AM|LINK
i put the ipaddress of the webserver in the network host & my IIS is already set to (All unassigned)...but still there is an error
is there anything to configure in my Default SMTP Virtual Server (IIS)?
I have seen a code like this
the problem is, it can only send emails thru our intranet emails, but if i want it to send to yahoo/hotmail, it doesnt send
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 01:27 PM|LINK
[quote user="Ez416"]the problem is, it can only send emails thru our intranet emails, but if i want it to send to yahoo/hotmail, it doesnt send
Have you tried authenticating to your mail server instead of using IIS SMTP? If not, I recommend you do that.
Ryan
rekoms
Participant
1354 Points
275 Posts
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 06:05 PM|LINK
Does someone know what to do with this???
http://forums.asp.net/1383977/ShowThread.aspx#1383977
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 06:54 PM|LINK
[quote user="rekoms"]Does someone know what to do with this???
That post is off topic to this thread. Please do not post off topic threads.
Ryan
dm19898
Member
118 Points
24 Posts
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 08:09 PM|LINK
[quote string myMessageBody = myMessageBody.Replace(@"\r\n", "<br />");
I am familiar with the string.replace function,
but could you please explain the use of "@"
Thanks-
Don
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 08:15 PM|LINK
[quote user="dm19898"]I am familiar with the string.replace function, but could you please explain the use of "@"
When you use a string that represents an escape character. You either need to use 2 \'s (\\) or @ in the front of a string like that.
Ryan
dm19898
Member
118 Points
24 Posts
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 08:20 PM|LINK
so that escape sequence is on the entire string?
the equivalent would be(?) ... myMessageBody.Replace("\\r\\n", "<br />");
Good to know-
Thanks !
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Aug 29, 2006 09:33 PM|LINK
[quote user="dm19898"]the equivalent would be(?) ... myMessageBody.Replace("\\r\\n", "<br />");
Yup.
Ryan
j_gaylord
Contributor
3444 Points
731 Posts
ASPInsiders
MVP
Re: HOW TO: Send email using System.Net.Mail
Sep 01, 2006 01:04 PM|LINK
ASPInsider and Microsoft MVP
http://jasongaylord.com
dua44
Member
5 Points
2 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 01, 2006 09:45 PM|LINK
i didnt see any thing like using system.net.mail
or imports system.net.mail
and u apply method instead of setting property
mMailMessage.To.Add(New MailAddress(recepient))