rss search

next page next page close

Use remote SMTP server with CDONTS.NewMail?

<%
    Set cdoConfig = CreateObject("CDO.Configuration")  

    With cdoConfig.Fields
        .Item(cdoSendUsingMethod) = cdoSendUsingPort
        .Item(cdoSMTPServer) = "<enter_mail.server_here>"
        .Update
    End With  

    Set cdoMessage = CreateObject("CDO.Message")  

    With cdoMessage
        Set .Configuration = cdoConfig
        .From = "from@me.com"
        .To = "to@me.com"
        .Subject = "Sample CDO Message"
        .TextBody = "This is a test for CDO.message"
        .Send
    End With  

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

next page next page close

Get CDO messages to return a read receipt?

<!--METADATA
    TYPE="typelib"
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
    NAME="CDO for Windows 2000 Library"
-->
<%
    ' since this doesn't *have* to match the from address
    receiptTo = "you@yourdomain.com"  

    Set cdoConfig = CreateObject("CDO.Configuration")
    Set cdoMessage = CreateObject("CDO.Message")  

    With cdoConfig.Fields
        .Item(cdoSendUsingMethod) = cdoSendUsingPort
        .Item(cdoSMTPServer) = "smtp.yourdomain.com"
        .Update
    End With  

    With cdoMessage
        .Fields(cdoDispositionNotificationTo) = receiptTo
        .Fields(cdoReturnReceiptTo) = receiptTo
        .Fields.Update  

        Set .Configuration = cdoConfig  

        .From = "you@yourdomain.com"
        .To = "them@theirdomain.com"
        .Subject = "Sample CDO Message"
        .TextBody = "This is a test for CDO.message"
        .Send
    End With  

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
%>

If you want to know about delivery in the event that a read receipt will never come, you can add a delivery status notification option of 4 (success) just before calling the .send method:

<%
    '...
        .DSNOptions = 4
        .Send
    '...
%>
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Use remote SMTP server with CDONTS.NewMail?

Share|<% Set cdoConfig = CreateObject("CDO.Configuration") With...
article post

Get CDO messages to return a read receipt?

Share|<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" ...
article post

Devguru.in is Stephen Fry proof thanks to caching by WP Super Cache