My code looks as below. I have already done the batch processing of .pdfs into the Invoices folder with the filename convention reflected below. I have also set up the SMTP configuration as anonymous, though I have also tried Basic, but with the same results. With basic, our smtp server in mail.myclient.ug, through hostgator web hosting servers in the US (Basically the domain is hosted on hostgator).
FileDirectory := ‘E:\Invoices’;
IF Customer.GET(“Sell-to Customer No.”) THEN
FileName := ‘Inv-’+Customer.“No.” +’-’+“No.”+’.pdf’;
cduMail.CreateMessage(‘Annual Invoice’,‘accounts@myclient.ug’,
‘copy@myclient.ug’,
‘Invoices for 2012/1013’,
‘Please confirm receipt’,
TRUE);
cduMail.AddCC(‘support@myclient.ug’);
cduMail.AddAttachment(FileDirectory+FileName);
cduMail.Send;
When I attempt to execute the code, I get the error “The SMTP mail system returned the following error: (0x80040213): The transport failed to connect to the server.”
Robert
Did you check that file is existing in the specidfied place
try
IF File.EXISTS(FileDirectory+FileName) THEN
cduMail.AddAttachment();
Also add SLEEP(1500) after addattachment
Seems not to help!
SLEEP(1500);
IF FILE.EXISTS(FileDirectory+FileName) THEN
cduMail.AddAttachment(FileDirectory+FileName);
SLEEP(1500);
cduMail.Send;
SLEEP(1500);
Robert
which smtp server are you using?
Which SMTP Server you are using?
HOSTGATOR hosts the domain and the mail server is mail.domain.com. Its working perfectly well on outlook mail, with or without ssl.
Robert
am using hostgator to host in the USA. So, my mail server is mail.domain.com.
It works on outlook with or without ssl (different ports)
Robert
You required to Put SMTP address in mail setup
I actually put the specific domain name: mail.myclientdomail.com.
Contact your System Admin for SMTP address of your mail.
Mr. Amol, I am specifying the right SMTP. As I said, the client is already using the mail system on outlook.
This SMTP is specified also in the outlook “Outgoing mail Server (SMTP” property.
Robert
Are you sure the username and password are correct in setup?
I found some topics when I google with error message…did you check all the posts?
http://lmgtfy.com/?q=The+transport+failed+to+connect+to+the+server+navision
I have looked. Matter of fact, I did a lot of googling and reading before posting. No solution there yet.
Robert
Interesting, one year later, I encouter the same problem. But this time round, I have an answer to tell the world. This error basically means, you are not accessing the SMTP server for whatever the reason. so look outside NAV, if your SMTP setup is correct. For example this error will show up if you unplugged the network cable.
But more things to check:
STMP port should be 25.
Check that ISP or LAN is not blocking this particular traffic.
to confirm, try putting the sending PC on a different internet service, such as a dongle. Once it work, you will be certain where to look.
Robert