Problem
Error trying to send email from Codeunit, where exchange is installed on the Navision database server
Code
SMTPMail.SetWorkMode();
SMTPMail.SetUserID('Administrator');
SMTPMail.SetFromAdress('from.co.uk');
SMTPMail.SetHost('192.x.x.x');
SMTPMail.Addline('Body of Email');
SMTPMail.SetToAdress('to.co.uk');
SMTPMail.SetSubType(1);
SMTPMail.Send;
Error
This message is for C/AL programmers:
The call to member Send failed. SmtpMailXControl1.SmtpMailX returned the following message:
503 5.5.2 Need rcpt command
0
Comments
Does your code actually say "SMTPMail.SetToAdress" or "SMTPMail.SetToAddress"? (the first one has one 'd' in 'Address', the second one has two). Does that make a difference?
Tim
As error 503 means "Bad sequence of commands" I suspect the problem is the order of your SMTPMail methods and properties.