Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Sending Email From ASP.NET 1.1

Reply
Thread Tools

Sending Email From ASP.NET 1.1

 
 
Robert E. Flaherty
Guest
Posts: n/a
 
      06-01-2005
Any suggestions on how to send email from an ASP.NET 1.1 app


 
Reply With Quote
 
 
 
 
Phin
Guest
Posts: n/a
 
      06-01-2005
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 = ""

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


 
Reply With Quote
 
Phin
Guest
Posts: n/a
 
      06-01-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to get the correct email format when sending email using sqldatareader rote ASP .Net 8 04-17-2008 02:14 AM
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 09:54 AM
sending an email... RAB ASP .Net 2 12-19-2006 04:48 PM
email sending twice Janet ASP .Net Web Controls 1 10-17-2006 03:22 PM
sending an email with asp isaac2004 ASP General 3 03-02-2006 08:00 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57