473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sending Email From ASP.NET 1.1

Any suggestions on how to send email from an ASP.NET 1.1 app
Nov 19 '05 #1
2 877
Robert,

Add the following to your function or method (define fields like
strSendFromName):
Dim mail As New System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail

mail.From = "\" & strSendFromName & "\ <" &
strSendFromEmail & ">"
mail.To = "\" & strSendToName & "\ <" & strSendToEmail &
">"

If strCC_ToEmail.Trim <> "" Then
mail.Cc = "\" & strCC_ToName & "\ <" & strCC_ToEmail &
">"
End If

mail.Bcc = "so*****@YourWebSite.com"

mail.Subject = strSubject
mail.Body = strMessage

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"SendEmailUser") 'set your username here

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"z&me2ruV") 'set your password here
SmtpMail.SmtpServer = strHost
SmtpMail.Send(mail)

Good luck,

Phin
Robert E. Flaherty wrote:
Any suggestions on how to send email from an ASP.NET 1.1 app


Nov 19 '05 #2
Robert,
Add the following to your function or method (define fields like
strSendFromName and give it a value):
Dim mail As New System.Web.Mail.MailMessage
Dim SmtpMail As System.Web.Mail.SmtpMail
mail.From = "\" & strSendFromName & "\ <" &
strSendFromEmail & ">"
mail.To = "\" & strSendToName & "\ <" & strSendToEmail &
">"
If strCC_ToEmail.Trim <> "" Then
mail.Cc = "\" & strCC_ToName & "\ <" & strCC_ToEmail &
">"
End If
mail.Bcc = "some...@YourWebSite.com"
mail.Subject = strSubject
mail.Body = strMessage
mail.Fields.Add("http://schemas.microsoft.com/c*do/configuration/smtpauthentic*ate",

"1") 'basic authentication
mail.Fields.Add("http://schemas.microsoft.com/c*do/configuration/sendusername",

"YOUR_EMAILUSER") 'set your username here
mail.Fields.Add("http://schemas.microsoft.com/c*do/configuration/sendpassword",

"YOUR_PASSWORD") 'set your password here
SmtpMail.SmtpServer = strHost
SmtpMail.Send(mail)
Good luck,
Phin

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
1
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.