+ Reply to Thread
Results 1 to 2 of 2

Thread: Sending Email with ASP and CDOSYS

  1. #1
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,533
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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
    %>
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  2. #2
    Barn Legend Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    1,522
    Rep Power
    5

    Good stuff....with my form, I used the HTML.

+ Reply to Thread

Similar Threads

  1. Sending Emails Using ASP.NET
    By richyrich in forum .NET Code Samples
    Replies: 5
    Last Post: July 6th, 2009, 05:21 AM
  2. help with email validation
    By Rebelle in forum JavaScript Programming
    Replies: 13
    Last Post: August 21st, 2008, 11:57 AM
  3. send Bulk email
    By peebman2000 in forum .NET Development
    Replies: 2
    Last Post: June 20th, 2008, 11:06 AM
  4. Sending Email using CDOSYS & Classic ASP
    By richyrich in forum ASP Code Samples
    Replies: 0
    Last Post: March 17th, 2008, 10:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO