Hi Milan,
> hb-Sendmail() is returning .T., but mail is not getting delivered.
> I have attached the log file. Can someone guide me, what am I doing wrong ?
This is the original problem:
>> 550 <
lotusi...@gmail.com> No such user here <<
The recipient email account does not exist, so the mail server is
complaining and not processing further commands. Then there is a bug in
hb_SendMail() around line 240-245 ...
oInMail:Write( hb_MailAssemble( cFrom, xTo, xCC, cBody, cSubject,;
aFiles, nPriority, lRead, cReplyTo, cCharset, cEncoding ) )
oInMail:Commit()
oInMail:Close()
RETURN .T.
... where hb_SendMail() commit()s and returns .T. whether the sender and
recipients are accepted or not, causing the two >> 500 command
unrecognized << error messages in the log file.
A better solution would be for hb_SendMail() to do something like this:
nResult := oInMail:Write( hb_MailAssemble( cFrom, xTo, xCC, cBody,;
cSubject, aFiles, nPriority, lRead, cReplyTo, cCharset,;
cEncoding ) )
if nResult == F_ERROR // Catches the original 550 problem
oInMail:Close()
RETURN .F.
else
oInMail:Commit()
oInMail:Close()
endif
RETURN .T.
Regards,
Klas