SMTP Error: Operation timed out

iperutilityiperutility Member Posts: 18
edited 2014-11-05 in NAV Three Tier
I'm having an issue while sending SMTP certified mail from Navision 2013.

Everytime I send a mail with the customer certified mail, the operation ALWAYS goes in timeout.
I'm not using Outlook: the operation has to go silent without external client.
Username and password are totally correct, since I can log on the account (checked it myself).
Network setup is ok too, as is the firewall: the port (465) is enabled and can send/receive.
I am using the standard 2013 SMTP codeunit, and I also debugged every line of code until the Send function: the message has correct recipients, no attachments and the correct sender address.
So, I am totally sure that everything NAV/Network part is ok.

My SMTP settings:

SMTP Server: smtps.pec.aruba.it
Base Authentication
Port 465
SSL Enabled

The server connects, no data is send/received, and the connection automatically drops after the timeout timer is reached.
Funny fact is, with NAV2009 I had to rewrite some of the SMTP function because of SSL not working, and the same address works perfectly, it can send emails from NAV without any use of external clients (outlook).
Any thoughts about this?
Mail sending without external clients is pretty vital to the product.
Thanks for your time and best regards.

Comments

  • vremeni4vremeni4 Member Posts: 323
    Hi,

    In my experience this usually happens when SMTP server excepts to get SSL certificate but client is sending something else. So the connection time-outs after some time as they are not on the same protocol.

    I would double check in the table 409 SMTP Mail Setup, if the flag "Secure Connection" set to True.
    Also I would try to set Authentication to NTLM.

    It may be also worth to use telnet to connect to SMTP server and find out what server expects.
    http://www.yuki-onna.co.uk/email/smtp.html
    After that you can run a network sniffer on your machine to see what is NAV sending to the SMTP Server.
    https://www.wireshark.org/

    I hope this helps.
    Thanks
  • iperutilityiperutility Member Posts: 18
    Hi,

    Thanks for replay me. I've tryed what You have told in the previous post, but unfortunately it didn't works. I've though to use the DotNet library of Dyanamics setuping a Global Variables

    Here below, I've wrote you my Dynamic NAV2013 function using the library DotNet System.Net.Mail.

    NB : I linked for you or someone else the explaining how set my mail SSL, the provider is Aruba.it

    Global variables :
    Name DataType Subtype Length
    SmtpClientDGA DotNet System.Net.Mail.SmtpClient.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
    MailMessageDGA DotNet System.Net.Mail.MailMessage.'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

    Local variables:
    Name DataType Subtype Length
    d Text 1024
    m Text 1024
    s Text 1024
    b Text 1024
    porta Integer

    Function:
    m := 'to';
    d := 'from';
    s := 'ssss';
    b := 'ddddd';

    //MailMessageDGA := MailMessageDGA.MailMessage(m,d,s,b);
    SmtpClientDGA := SmtpClientDGA.SmtpClient();
    SmtpClientDGA.Host('smtps.pec.aruba.it');
    IF EVALUATE(porta,'465') THEN BEGIN
    SmtpClientDGA.Port(porta);
    SmtpClientDGA.UseDefaultCredentials := TRUE;
    SmtpClientDGA.EnableSsl := TRUE;
    SmtpClientDGA.Send(m,d,s,b);
    END;
Sign In or Register to comment.