tags:

views:

53

answers:

2

i tried this:

        Dim mail
        mail = Server.CreateObject("CDO.Message")
        mail.To = consul.Email
        mail.From = "[email protected]"
        mail.Subject = subj
        mail.HTMLBody = Bdy
        mail.Send()
        mail = Nothing

It gave me the following error: The "SendUsing" configuration value is invalid.

A: 
Cj Anderson
A: 

Try this function:

Public Sub SendMsg(from, dest, subj, body)
    Dim msg, flds, conf

    Set msg = CreateObject("CDO.Message")
    Set conf = CreateObject("CDO.Configuration")
    Set flds = conf.Fields

    flds(cdoSendUsingMethod) = cdoSendUsingPort
    flds(cdoSMTPServer) = "smtp.xyz.org"
    flds(cdoSMTPServerPort) = 25

'if use SMTP authentication...
        flds(cdoSMTPAuthenticate) = cdoBasic
        flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = "xxxxxx"
        flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "zzzzzz"
    '... or, without SMTP authentication
        flds(cdoSMTPAuthenticate) = cdoAnonymous

    flds.Update

    On Error Resume Next
    With msg
        Set .Configuration = conf
        .BodyPart.CharSet = "utf-8"
        .TextBodyPart.CharSet = "utf-8"
        .To = dest
        .From = from
        .Subject = subj
        .TextBody = body
        .Send
    End With
    On Error Goto 0

    set msg = nothing
    set conf = nothing
    set flds = nothing
End Sub
Fabio