DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

Sending Email with ASP and CDOSYS

This is a discussion on Sending Email with ASP and CDOSYS within the ASP Code Samples forums, part of the ASP Development category; How to send a simple text email: Code: <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com" myMail.To="someone@somedomain.com" myMail.TextBody="This is a ...

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development > ASP Code Samples

  #1  
Old July 17th, 2008, 09:59 AM
jmurrayhead's Avatar
The Barnfather
 
Join Date: Mar 2008
Real name: Jason
Location: Washington, D.C.
Posts: 1,964
Blog Entries: 8
Rep Power: 15
jmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud ofjmurrayhead has much to be proud of
Default Sending Email with ASP and CDOSYS

How to send a simple text email:
Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
How to send a text email with Bcc and CC options:
Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.Bcc="someoneelse@somedomain.com"
myMail.Cc="someoneelse2@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
How to send an HTML email:
Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.HTMLBody = "<h1>This is a message.</h1>" 
myMail.Send
set myMail=nothing
%>
How to send a text email with an attachment:
Code:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.AddAttachment "c:\mydocuments\test.txt"
myMail.Send
set myMail=nothing
%>

Comments on this post
Rebelle agrees: Thanked Post
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

If you like it here...throw us a few bones to help
support us.

Join our Folding team: DeveloperBarn Folding

Reply With Quote
The Following User Says Thank You to jmurrayhead For This Useful Post:
Rebelle (November 13th, 2008)
  #2  
Old November 13th, 2008, 09:26 AM
Rebelle's Avatar
Barn Loyal
 
Join Date: Mar 2008
Posts: 748
Rep Power: 2
Rebelle will become famous soon enough
Default

Good stuff....with my form, I used the HTML.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development > ASP Code Samples

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Sending Emails Using ASP.NET richyrich .Net Code Samples 5 July 6th, 2009 04:21 AM
help with email validation Rebelle JavaScript Programming 13 August 21st, 2008 10:57 AM
send Bulk email peebman2000 .Net Development 2 June 20th, 2008 10:06 AM
Sending Email using CDOSYS & Classic ASP richyrich ASP Code Samples 0 March 17th, 2008 09:52 AM


All times are GMT -4. The time now is 10:59 AM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2