• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

Sample CDOSYS Email Script


Below is a sample script you can copy and paste in order to test CDOSYS functionality:

<% 
Dim MyMail
Set MyMail = CreateObject("CDO.Message")
MyMail.From = "You@YourDomain.com"
MyMail.To = "YouAgain@YourOtherAddress.com"
MyMail.Subject = "Test message using CDOSYS"
MyMail.TextBody ="This is a test email message" & vbcrlf & "sent with CDOSYS"
MyMail.Send
Set MyMail= nothing
Response.Write("Your e-mail has been sent")
%>


© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

6 Comments

The sample code above needs some newlines. It should be:

<code>
<%
Dim MyMail
Set MyMail = CreateObject("CDO.Message")
MyMail.From = "You@YourDomain.com"
MyMail.To = "YouAgain@YourOtherAddress.com"
MyMail.Subject = "Test message using CDOSYS"
MyMail.TextBody ="This is a test email message" & vbcrlf & "sent with CDOSYS"
MyMail.Send
Set MyMail= nothing
Response.Write("Your e-mail has been sent")
%>
</code>

Oof, you're quite correct. We'll get that fixed right away. Thanks for letting us know.

Jerred,

I spent many hours trying to test this code. I should have read the comment below that Will made. I would recommend updating the script above, as I am sure other will come across the same issue!

Thanks!

Blast, I thought I had fixed that. Thanks James. I'll edit it again, and hopefully this time it will stick.

No problem, just thought I would help!

Is there anyway to set an email as Private using CDOSYS?

I've tried cdoMessage.Sensitivity = cdoPrivate, but I'm getting the "object not supported" error.

Many thanks in advance!

Add new comment