Richard Elgert
asked on
CDO mail
I have code to send CDO emails to vendors - all works fine except now have a vendor with subdomain in address like this for example rich.smith@PW.UOC.Com - that fails - is there a way around it with CDO
Try to capture the mail conversation (for instance, Wireshark. If it passes through another of your server, capture there also). Subdomains have no influence on how CDO works. It's probably something else. Could you post your code too?
ASKER
I have no way to track the other stuff but error message says
Email error: - 07:48:14 08/28/15 Error occurred while accessing component property/method: Send.
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay
Error code: 0x80020009 SendCDOMail C:\symwork\p91824_CDOMail2 015.ped (5890) - Number - 5890
but all emails work so
code
DEF VAR MyMailTo AS CHAR.
DEF VAR MyMailFrom AS CHAR.
DEF VAR MyCCTo AS CHAR.
DEF VAR MySubJect AS CHAR.
DEF VAR MyMessage AS CHAR.
DEF VAR MyFilePath AS CHAR.
DEF VAR MyErrorMessage AS CHAR.
DEF VAR MyNMRCost AS INT.
/* MyMailTo = "becky.evans@mjsections.co .uk". */
/* MyMailTo = "Richard.Elgert@paradigmpr ecision.co m". */
MyMailTo = "janet.denis@pw.utc.com".
/* MyMailTo = "Janet.Denis <janet.denis@pw.utc.com>". */
/* name not final _PostingGroup@paradigmprec ision.com Ali working on getting group set up */
/* MyMailTo = MyMailTo + "_PostingGroup@paradigmpre cision.com ". */
MyMailFrom = "server@paradigmprecision. com".
MyCCTo = "Richard.Elgert@paradigmpr ecision.co m".
MySubJect = "Testing email from code ".
/* add as much info as possible */
MyMessage = "Please advise if you received this.".
RUN SendCDOMail.
/* always reset variables */
MyMailTo = "".
MyMailFrom = "".
MyCCTo = "".
MySubJect = "".
MyMessage = "".
QUIT.
PROCEDURE SendCDOMail.
DEF VAR cFileName AS CHAR NO-UNDO.
DEF VAR MyCDOFrom AS CHAR NO-UNDO.
DEF VAR MyCDOTo AS CHAR NO-UNDO.
DEF VAR MyCDOMsg AS CHAR NO-UNDO.
DEF VAR MyCDOSubj AS CHAR NO-UNDO.
DEF VAR MyCDOCC AS CHAR NO-UNDO.
DEF VAR MyCDOAttach AS CHAR NO-UNDO.
DEF VAR MyCDOHyperLink AS CHAR NO-UNDO.
DEF VAR oSuccessful AS LOG NO-UNDO.
MyCDOFrom = MyMailFrom.
MyCDOTo = MyMailTo.
MyCDOCC = MyCCTo. /* "relgert@tct-inc.com". */
MyCDOSubj = MySubJect.
/* this for text only message see below for HTML */
MyCDOMsg = MyMessage.
MyCDOAttach = "". /* MyExcelFile. */
/* must have FILE:// for hyperlink to work */
MyCDOHyperLink = "". /*"File://" + cFileName.*/
DO ON ERROR UNDO, LEAVE:
DEF VAR objMessage AS COM-HANDLE.
/* RDE 8/7/12 this was a return from */
oSuccessful = YES.
CREATE "CDO.Message" objMessage.
objMessage:Subject = MyCDOSubj.
objMessage:From = MyCDOFrom.
objMessage:To = MyCDOTo.
objMessage:CC = MyCDOCc.
/* this works */
objMessage:HtmlBody = MyCDOMsg.
/* this works */
/*objMessage:AddAttachment (MyCDOAtta ch,"",""). */
/* = 2 is norm casarray.palmermfgco.local */
objMessage:Configuration:F ields:Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2.
/* Name or IP of remote SMTP server */
objMessage:Configuration:F ields:ITEM ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.168.69".
/* 'Server port */
objMessage:Configuration:F ields:ITEM ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25.
/* this line gives error on subdomain in address */
objMessage:Configuration:F ields:Upda te().
objMessage:Send().
/* RDE 8/7/12 this was a return from SMTP */
CATCH eError AS PROGRESS.lang.ERROR:
oSuccessful = NO.
MyErrorMessage = eERROR:getmessage(1) + " - Number - " + STRING(eERROR:getmessageNu m(1),"zzzz 9").
RUN WriteErrorToFile.
END CATCH.
END.
END.
PROCEDURE WriteErrorToFile.
OUTPUT TO R:\ErrorFolder\PostingEMai lErrors.tx t APPEND UNBUFFERED.
PUT UNFORMATTED "Email error: - " + STRING(TIME, "HH:MM:SS") + " "
+ STRING(TODAY,"99/99/99") + " " + MyErrorMessage SKIP.
/* + STRING(TIME, "HH:MM:SS") + " " */
OUTPUT CLOSE.
END.
.
Email error: - 07:48:14 08/28/15 Error occurred while accessing component property/method: Send.
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay
Error code: 0x80020009 SendCDOMail C:\symwork\p91824_CDOMail2
but all emails work so
code
DEF VAR MyMailTo AS CHAR.
DEF VAR MyMailFrom AS CHAR.
DEF VAR MyCCTo AS CHAR.
DEF VAR MySubJect AS CHAR.
DEF VAR MyMessage AS CHAR.
DEF VAR MyFilePath AS CHAR.
DEF VAR MyErrorMessage AS CHAR.
DEF VAR MyNMRCost AS INT.
/* MyMailTo = "becky.evans@mjsections.co
/* MyMailTo = "Richard.Elgert@paradigmpr
MyMailTo = "janet.denis@pw.utc.com".
/* MyMailTo = "Janet.Denis <janet.denis@pw.utc.com>".
/* name not final _PostingGroup@paradigmprec
/* MyMailTo = MyMailTo + "_PostingGroup@paradigmpre
MyMailFrom = "server@paradigmprecision.
MyCCTo = "Richard.Elgert@paradigmpr
MySubJect = "Testing email from code ".
/* add as much info as possible */
MyMessage = "Please advise if you received this.".
RUN SendCDOMail.
/* always reset variables */
MyMailTo = "".
MyMailFrom = "".
MyCCTo = "".
MySubJect = "".
MyMessage = "".
QUIT.
PROCEDURE SendCDOMail.
DEF VAR cFileName AS CHAR NO-UNDO.
DEF VAR MyCDOFrom AS CHAR NO-UNDO.
DEF VAR MyCDOTo AS CHAR NO-UNDO.
DEF VAR MyCDOMsg AS CHAR NO-UNDO.
DEF VAR MyCDOSubj AS CHAR NO-UNDO.
DEF VAR MyCDOCC AS CHAR NO-UNDO.
DEF VAR MyCDOAttach AS CHAR NO-UNDO.
DEF VAR MyCDOHyperLink AS CHAR NO-UNDO.
DEF VAR oSuccessful AS LOG NO-UNDO.
MyCDOFrom = MyMailFrom.
MyCDOTo = MyMailTo.
MyCDOCC = MyCCTo. /* "relgert@tct-inc.com". */
MyCDOSubj = MySubJect.
/* this for text only message see below for HTML */
MyCDOMsg = MyMessage.
MyCDOAttach = "". /* MyExcelFile. */
/* must have FILE:// for hyperlink to work */
MyCDOHyperLink = "". /*"File://" + cFileName.*/
DO ON ERROR UNDO, LEAVE:
DEF VAR objMessage AS COM-HANDLE.
/* RDE 8/7/12 this was a return from */
oSuccessful = YES.
CREATE "CDO.Message" objMessage.
objMessage:Subject = MyCDOSubj.
objMessage:From = MyCDOFrom.
objMessage:To = MyCDOTo.
objMessage:CC = MyCDOCc.
/* this works */
objMessage:HtmlBody = MyCDOMsg.
/* this works */
/*objMessage:AddAttachment
/* = 2 is norm casarray.palmermfgco.local
objMessage:Configuration:F
/* Name or IP of remote SMTP server */
objMessage:Configuration:F
/* 'Server port */
objMessage:Configuration:F
/* this line gives error on subdomain in address */
objMessage:Configuration:F
objMessage:Send().
/* RDE 8/7/12 this was a return from SMTP */
CATCH eError AS PROGRESS.lang.ERROR:
oSuccessful = NO.
MyErrorMessage = eERROR:getmessage(1) + " - Number - " + STRING(eERROR:getmessageNu
RUN WriteErrorToFile.
END CATCH.
END.
END.
PROCEDURE WriteErrorToFile.
OUTPUT TO R:\ErrorFolder\PostingEMai
PUT UNFORMATTED "Email error: - " + STRING(TIME, "HH:MM:SS") + " "
+ STRING(TODAY,"99/99/99") + " " + MyErrorMessage SKIP.
/* + STRING(TIME, "HH:MM:SS") + " " */
OUTPUT CLOSE.
END.
.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for Huntlee2015's comment #a40951837
for the following reason:
don't know if correct sys admin people have not responded to my help ticket
Accepted answer: 0 points for Huntlee2015's comment #a40951837
for the following reason:
don't know if correct sys admin people have not responded to my help ticket
Just because someone else didn't respond or confirm my answer doesn't mean you should have your own comment assigned as the correct solution?
ASKER