[AccessD] Error Sending Emails Through Exchange

John W Colby jwcolby at gmail.com
Mon Mar 17 16:30:23 CDT 2014


I took to using gmail since I could avoid all the "server issues".

John W. Colby

Reality is what refuses to go away
when you do not believe in it

On 3/17/2014 5:24 PM, David A Gibson wrote:
> We used to send emails by Word mailmerge until an Exchange update screwed
> that up for us.  Now it's hit or miss.
>
> David Gibson
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
> Sent: Monday, March 17, 2014 3:54 PM
> To: AccessD
> Subject: [AccessD] Error Sending Emails Through Exchange
>
> Hi Listers,
>
>   
>
> Below is the error message my Access database is getting when I try to send
> out an email using cdosys.dll:
>
>   
>
> Error Number : -2147220977
>
> Error Msg: The server rejected one or more recipient addresses.  The server
> response was: 550 5.7.1 Unable to relay.
>
>   
>
> The VBA code I am using is below:
>
>   
>
>      Dim msg As Message, strSMTPServer As String, intSMTPConnectionTimeout As
> Integer, intSMTPServerPort As Integer
>
>      Dim strOrganisation As String, strFrom As String, strSubject As String,
> strBody As String, strHeader As String
>
>   
>
>      strSMTPServer = DLookup("EmailSMTPServer", "tlkpVariable", "VariableID =
> 1")
>
>      intSMTPConnectionTimeout = DLookup("EmailSMTPConnectionTimeout",
> "tlkpVariable", "VariableID = 1")
>
>      intSMTPServerPort = DLookup("EmailSMTPServerPort", "tlkpVariable",
> "VariableID = 1")
>
>      strOrganisation = DLookup("EmailOrganisation", "tlkpVariable",
> "VariableID = 1")
>
>      strFrom = DLookup("EmailSender", "tlkpVariable", "VariableID = 1")
>
>      strSubject = DLookup("EmailSubject", "tlkpVariable", "VariableID = 1")
>
>      strBody = DLookup("EmailBody", "tlkpVariable", "VariableID = 1")
>
>   
>
>          Set msg = CreateObject("CDO.Message")
>
>          With msg
>
>              With .Configuration.Fields
>
>                  .Item(cdoSMTPAuthenticate) = cdoAnonymous
>
> '                .Item(cdoSMTPAuthenticate) = cdoBasic
>
> '                .Item(cdoSendUserName) = "username"
>
> '                .Item(cdoSendPassword) = "password"
>
>                  .Item(cdoSendUsingMethod) = cdoSendUsingPort
>
>                  .Item(cdoSMTPServer) = strSMTPServer
>
>                  .Item(cdoSMTPConnectionTimeout) = intSMTPConnectionTimeout
>
>                  .Item(cdoSMTPServerPort) = intSMTPServerPort
>
>                  .Update
>
>              End With
>
>              .Organization = strOrganisation
>
>              .To = strTo
>
>              .Subject = Nz(strSubject, " ")
>
>              .TextBody = Nz(strBody, " ")
>
>              .From = strFrom
>
>              .Send
>
>          End With
>
>          Set msg = Nothing
>
>     
>
>   
>
> The lines in red above have also been tried using the users windows logon
> and password but the same message appeared (not sure if this was the correct
> data for these properties though).
>
>   
>
> The code has worked fine for other clients but they have not used Microsoft
> Exchange for their emails.
>
> It also works if the recipient address has the same domain as the server.
>
>   
>
> Any help would be appreciated.
>
>   
>
> Regards
>
> David Emerson
> Dalyn Software Ltd
> Wellington, New Zealand
>
>   
>
>   
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com



More information about the AccessD mailing list