View Single Post
  #2   Report Post  
Bill22 Bill22 is offline
Junior Member
 
Location: Edinburgh, Scotland
Posts: 3
Default

Some of the code got lost in translation. Here it is again, properly in full:
Code:
Sub TestingGmail()

    Dim iMsg As Object, iConf As Object

    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
    
    iConf.Load -1    ' CDO Source Defaults.
    Set Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "
        .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "(gmailusers password)"
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'        .Item("http://schemas.microsoft.com/cdo/configuration/senduserreplyemailaddress") = "
        .Update
    End With

    On Error Resume Next
    With iMsg
        Set .Configuration = iConf
        .To = "
        .CC = ""
        .BCC = ""
        .ReplyTo = "
        .From = """replytoname"" "
        .Subject = "Title"
        .TextBody = "Text body"
        .Send
    End With
    
    On Error GoTo 0
    
    Set iMsg = Nothing
    Set iConf = Nothing
End Sub
Managed to switch off the parsing so it all comes out right now. Sorry 'bout that - must have been a bit confusing with bits missing.

Bill