Archived Forum Post

Index of archived forum posts

Question:

send mail with smtp port 587

Sep 03 '13 at 03:49

Hi, i use chilkatmail with cobol and i have a problem when i send a mail with smtp port 587, always return an error of access denied

this is my program

           CREATE  ChilkatMailMan2      OF CHILKATMAILLib2
                   HANDLE           IN hMail.
      * assegno il codice del prodotto
           modify hMail @UnlockComponent('***').
      * assegno l'SMTP per l'invio della mail
           modify hMail @SmtpHost = 'smtp.fastwebnet.it'.
           modify hMail @MailHost = 'pop.fastwebnet.it'.
           modify hMail @SmtpPort = 587.
           modify hMail @SmtpUsername = PAR-USER
           modify hMail @PopUsername = PAR-USER
           modify hMail @SmtpPassword = PAR-PASW
           modify hMail @PopPassword = PAR-PASW.
           modify hMail @StartTLS = 1.
      * creo ila nuova mail
           modify hMail @NewEmail() giving hChi.
      * titolo della mail
           modify hChi  @subject = PAR-TITOLO.
      * mittente
           modify hChi  @From = PAR-FROM.
           perform varying ind from 1 by 1 until ind > 10
              if par-indi(ind) > space
      * destinatario
                 modify hChi  @AddTo (' ',par-indi(ind))
              end-if
              if par-cono(ind) > space
           end-perform.
      * testo della mail
           modify hChi  @Body = PAR-BODY.

  * richiesta conferma di lettura
       IF PAR-RETURN = 'S'
          modify hChi  @ReturnReceipt = 1.
  * invio mail
       modify hMail @SendEmail(hChi) giving ok.
       move zero              to set-swer.
       move space             to set-mess.
       if ok not = 1
          inquire hmail @LastErrorText in messaggio
          move 1              to set-swer
          move messaggio      to set-mess.
  *chiusura dell'oggetto generato
       destroy hChi.
       destroy hMail.

and the error message is
ChilkatLog:
  SendEmail:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: *
    Username: ***
    Architecture: Little Endian; 32-bit
    Language:
 ActiveX
    VerboseLogging: 0
    recipients:
      TO: *
      TO: *
      totalCount: 2
    --recipients
    renderToMime:
      createEmailForSending:

   xSigningAlg: sha1
    Auto-generating Message-ID
  --createEmailForSending
  renderToMime: Elapsed time: 0 millisec
--renderToMime
progressTotal: 73466
SmtpConnect

: SmtpHost: smtp.fastwebnet.it SmtpPort: 587 SmtpUsername: ***** SmtpSsl: 0 StartTLS: 1 Need new SMTP connection checkForExistingConnection: Elapsed time: 0 millisec SMTP_Connect: Connecting to SMTP server smtp.fastwebnet.it:587 smtp_host: smtp.fastwebnet.it smtp_port: 587 smtp_user: **** ConnectTimeoutMs_1: 30000 calling ConnectSocket2 IPV6 enabled connect with NO heartbeat. connectingTo: smtp.fastwebnet.it resolveHostname1:

     Resolving domain name (IPV4) via gethostbyname
    --resolveHostname1
    GetHostByNameHB_ipv4: Elapsed time: 62 millisec
    myIP_1: 127.0.0.1
    myPort_1: 64343

connect successful (1) Turning on TCP_NODELAY. socketOptions: SO_SNDBUF: 65536 SO_RCVBUF: 65536 TCP_NODELAY: 1 --socketOptions socketConnect: Elapsed time: 62 millisec SmtpCmdResp: 554 mr003msr.fastwebnet.it Service not available - access denied 554 mr003msr.fastwebnet.it Service not available - access denied

    Failed to get initial SMTP response..
    Will re-try one time...
    ConnectTimeoutMs_1: 30000
    calling ConnectSocket2
    IPV6 enabled connect with NO heartbeat.

 connectingTo: smtp.fastwebnet.it
    resolveHostname1:
      Resolving domain name (IPV4) via gethostbyname
    --resolveHostname1
    GetHostByNameHB_ipv4: Elapsed time: 0 millisec
    myIP_1: 127.0.0.1
    myPort_1: 64345
    connect successful (1)
    Turning on TCP_NODELAY.
    **SmtpCmdResp: 554 mr003msr.fastwebnet.it Service not available - access denied
    554 mr003msr.fastwebnet.it Service not available - access denied
    InitialResponse2: 554 mr003msr.fastwebnet.it Service not available - access denied**
    Failed to get initial SMTP response again.
  --SMTP_Connect
  checkOrMakeSmtpConnection: Elapsed time: 530 millisec
--SmtpConnect
Failed.

--SendEmail --ChilkatLog

thank you Marcello


Answer

Check to see what smtp.fastwebnet.it requires for SMTP settings. Maybe it's not supposed to receive connections on port 587? Each provider should publish specific settings for its various services: POP3, IMAP, SMTP, etc.

Also, maybe it doesn't like the IP address from which your connecting?

Finally, Google the error message to research others that may have had the same problem.
Google "554 Service not available - access denied"


Answer

The port and the SMTP is correst but i need to active the Authenticated access, maybe this is my problem

now i try to change IP address