Skip to main content

[archive] C$SOCKET and SMTP with gmail anyone?

  • December 30, 2008
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 30 December 2008]

Has anyone out there tried sending mail using the gmail smtp server, smtp.gmail.com and Acucobol C$SOCKET?

It's doable from normal mail applications like Windows Mail or MS Outlook.

Gmail uses non-standard ports and SSL.

Would it be possible to rewrite the winbmail.cbl example posted here years ago to do this?

regards,
Hans Jivesten

4 replies

[Migrated content. Thread originally posted on 30 December 2008]

Has anyone out there tried sending mail using the gmail smtp server, smtp.gmail.com and Acucobol C$SOCKET?

It's doable from normal mail applications like Windows Mail or MS Outlook.

Gmail uses non-standard ports and SSL.

Would it be possible to rewrite the winbmail.cbl example posted here years ago to do this?

regards,
Hans Jivesten
The standard demo on smtp mail, is using port 25, if you just alter that value to whatever port is desired, it should be all you have to do.

Like, if you should use port 1234, change this:


      *You should set your smtp server here:
      * You must check with your IS dept. It might be mail.yourdomain.xyz
           STRING  "smtp.yourdomain.xyz" LOW-VALUES
                   DELIMITED        BY SIZE
                   INTO             SERVER-NAME.
           CALL    "C$SOCKET"       USING
                   AGS-CREATE-CLIENT
                   25
                   SERVER-NAME
                   GIVING           SOCKET-HANDLE.


to this:


      *You should set your smtp server here:
      * You must check with your IS dept. It might be mail.yourdomain.xyz
           STRING  "smtp.yourdomain.xyz" LOW-VALUES
                   DELIMITED        BY SIZE
                   INTO             SERVER-NAME.
           CALL    "C$SOCKET"       USING
                   AGS-CREATE-CLIENT
                   1234
                   SERVER-NAME
                   GIVING           SOCKET-HANDLE.

[Migrated content. Thread originally posted on 30 December 2008]

Has anyone out there tried sending mail using the gmail smtp server, smtp.gmail.com and Acucobol C$SOCKET?

It's doable from normal mail applications like Windows Mail or MS Outlook.

Gmail uses non-standard ports and SSL.

Would it be possible to rewrite the winbmail.cbl example posted here years ago to do this?

regards,
Hans Jivesten
Gisle,

Thanks fo a quick reply.

I have tested with port 465 which is the port used by gmail for sending through their SMTP server. However, it does not work.

I Windows Mail one also has to check the SSL check box for outgoing (and incoming pop3). I guess this changes the behaviour in some way but I'm not sure how.

Winbmail never comes back from the first call to RECEIVE-DATA. The C$SOCKET/AGS-READ never returns.

I tried with and without setting WINBMAIL-USER to my gmail account.

In both cases it's the first call to RECEIVE-DATA which fails by not returning from the AGS-READ.

Best regards,
Hans

[Migrated content. Thread originally posted on 30 December 2008]

Has anyone out there tried sending mail using the gmail smtp server, smtp.gmail.com and Acucobol C$SOCKET?

It's doable from normal mail applications like Windows Mail or MS Outlook.

Gmail uses non-standard ports and SSL.

Would it be possible to rewrite the winbmail.cbl example posted here years ago to do this?

regards,
Hans Jivesten
SSL is not something I took into consideration, obviously, it means you have to be able to decode/encode. I have no idea if that is doable. Sorry.

[Migrated content. Thread originally posted on 30 December 2008]

Has anyone out there tried sending mail using the gmail smtp server, smtp.gmail.com and Acucobol C$SOCKET?

It's doable from normal mail applications like Windows Mail or MS Outlook.

Gmail uses non-standard ports and SSL.

Would it be possible to rewrite the winbmail.cbl example posted here years ago to do this?

regards,
Hans Jivesten
SSL is not something I took into consideration, obviously, it means you have to be able to decode/encode. I have no idea if that is doable. Sorry.