troubleshooting Question

Changed from EXCHANGE SERVER to Google APPS /// Sending EMAIL with CDO.Configuation code VBA -

Avatar of Dale Massicotte
Dale MassicotteFlag for United States of America asked on
Microsoft AccessExchange
7 Comments2 Solutions992 ViewsLast Modified:
Why wont this code work.  I changed the smtp server from our local ip to as we are now using google apps instead of exchange server.

Dim iCfg As Object
    Dim iMsg As Object
    Set iCfg = CreateObject("CDO.Configuration")
    Set iMsg = CreateObject("CDO.Message")
    With iCfg.Fields
        .Item("") = 2
        .Item("") = 25
        .Item("")    = ""
        '.Item("") = 1
        '.Item("") = "GxxxxxCxxxxxr"
        '.Item("") = "xxx9xx"
        .Item("") = ""
    End With
    With iMsg
        .Configuration = iCfg
        .subject = "WB:" & WaybillNumber & " READY:  " & txtReadyPrompt
        .To = ptn & sfx  '""
        '.To = ptn & ""  '""
        '.CC = ""
        '.BCC = ""
        .FROM = ""        '.FROM = ""
        'If StrComp(Left(strMessageBody, 6), "<HTML>", vbTextCompare) = 0 Then
        '    .HTMLBody = "HTML TEXT"
            .TextBody = FormDetail
        'End If
        'Add any specified attachments
        '.AddAttachment "Attachment path"
    End With

This code will not work.  Note that I commented out these lines

        '.Item("") = 1
        '.Item("") = "GxxxxxCxxxxxr"
        '.Item("") = "xxx9xx"

The error message I get is:

The server rejected one or more recipient email addresses.  The server response was 550 5.1.1

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros