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 aspmx.l.google.com 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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")    = "aspmx.l.google.com"
        '.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        '.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "GxxxxxCxxxxxr"
        '.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxx9xx"
        .Item("http://schemas.microsoft.com/cdo/configuration/sendemailaddress") = "dispatch@premierexpress.net"
        .Update
    End With
 
 
    With iMsg
        .Configuration = iCfg
        .subject = "WB:" & WaybillNumber & " READY:  " & txtReadyPrompt
        .To = ptn & sfx  '"dalerwhaler@yahoo.com"
        '.To = ptn & "@txt.att.net"  '"dalerwhaler@yahoo.com"
        '.CC = "cc@email.com"
        '.BCC = "bcc@email.com"
        .FROM = "dispatch@premierexpress.net"        '.FROM = "from@email.com"
 
        'If StrComp(Left(strMessageBody, 6), "<HTML>", vbTextCompare) = 0 Then
        '    .HTMLBody = "HTML TEXT"
        'Else
            .TextBody = FormDetail
        'End If
       
        'Add any specified attachments
        '.AddAttachment "Attachment path"
 
        .send
    End With

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

        '.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        '.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "GxxxxxCxxxxxr"
        '.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxx9xx"


The error message I get is:

The server rejected one or more recipient email addresses.  The server response was 550 5.1.1
http://support.google.com/mail/bin/answer.py?answer=6596
gg6si2491634qab.73
ASKER CERTIFIED SOLUTION
cnpz

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