• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Smtp Mail Setup

Coop

New Member
#2
Appears to be latest version, hasn't changed much it several years. We use it for everything including in Webspeed with OpenEdge v10.
http://freeframework.sourceforge.net/downloads/new/smtpmail/smtpmailv5_8c.p


This is what a clean run would look like:
************** ****** New Group ******* ************
Socket email started
Input Parameters
EmailFrom = noreply@compi.com
EmailReplyTo =
EmailTo = user1@compi.com
EmailCC =
Attachments = rpt-user1-1052am.xls
LocalFiles = /public/rpt-user1-1052am.xls
Subject = Financial Statement by Fiscal Period Report
Body = Requested Report Attached
MIMEHeader =
LocalHostName = mail.compconnect.com
Delivery Receipt = no
Read Receipt = no
DoAuth = no
AuthType =
User =
Password =
11/10/17 10:52:37 processing Attachment /public/rpt-user1-1052am.xls
11/10/17 10:52:37 opening socket
11/10/17 10:52:37 Socket Connection Established.
11/10/17 10:52:37 Begin read state 1
RESP:220 mail.compi.com ESMTP IceWarp 9.4.2; Fri, 10 Nov 2017 10:52:37 -0600

11/10/17 10:52:37 1 220 HELO
11/10/17 10:52:37 newstate 5
CLIENT:HELO mail.compconnect.com

11/10/17 10:52:37 End read state 5
11/10/17 10:52:37 Begin read state 5
RESP:250 mail.compi.com Hello mail.compconnect.com [10.202.6.7], pleased to meet you.

11/10/17 10:52:37 5 250 Mail From
11/10/17 10:52:37 newstate 6
CLIENT:MAIL From: noreply@compi.com

11/10/17 10:52:37 Recipient Cnt: 1
11/10/17 10:52:37 End read state 6
11/10/17 10:52:37 Begin read state 6
RESP:250 2.1.0 <noreply@compi.com>... Sender ok

11/10/17 10:52:37 6 250 Mail TO/CC 1 of (To:1 cc:0)
11/10/17 10:52:37 1 Email to user1@compi.com
11/10/17 10:52:37 newstate 7
CLIENT:RCPT TO: user1@compi.com

11/10/17 10:52:37 End read state 7
11/10/17 10:52:37 Begin read state 7
RESP:250 2.1.5 <user1@compi.com>... Recipient ok; will forward

11/10/17 10:52:37 7 250 Data
11/10/17 10:52:37 newstate 8
CLIENT:DATA

11/10/17 10:52:37 End read state 8
11/10/17 10:52:37 Begin read state 8
RESP:354 Enter mail, end with "." on a line by itself

11/10/17 10:52:37 8 354 build header/send data
11/10/17 10:52:37 in getfile /public/rpt-user1-1052am.xls
/public/rpt-user1-1052am.xls
FRW
951813
11/10/17 10:52:37 newstate 9
CLIENT:.

11/10/17 10:52:37 End read state 9
11/10/17 10:52:37 Begin read state 9
RESP:250 2.6.0 952436 bytes received in 00:00:00; Message id ZBK23137 accepted for delivery

11/10/17 10:52:37 9 250 send quit
11/10/17 10:52:37 newstate 10
CLIENT:QUIT

11/10/17 10:52:37 End read state 10
11/10/17 10:52:37 End SMTP Session
11/10/17 10:52:52
 
#3
Thank you coop for your reply. currently im using the version you have mentioned. previously mentioned error has fixed after removing the SMTP port number. now it gives a new error. first i mentioned the error message, secondly i mentioned the error log.

---------------------------
Information
---------------------------
no
501 5.5.4 Invalid domain name [HK2PR04CA0056.apcprd04.prod.outlook.com]

---------------------------
OK
---------------------------
=====================================================================
11/13/17 12:32:00
************** ****** New Group ******* ************
Socket email started
Input Parameters
EmailFrom = kasun@abansfinance.lk
EmailReplyTo =
EmailTo = kasundha@gmail.com
EmailCC =
Attachments =
LocalFiles =
Subject = Early Settlement
Body = test
MIMEHeader =
LocalHostName = KASUN-IT
Delivery Receipt = no
Read Receipt = no
Importance = 1
DoAuth = yes
AuthType = base64
User = kasun@abansfinance.lk
Password = <Hidden>
11/13/17 12:32:00 opening socket
11/13/17 12:32:00 Socket Connection Established.
11/13/17 12:32:01 Number of lines: 2
str:220 HK2PR04CA0056.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 13 Nov 2017 07:02:38 +0000


11/13/17 12:32:01 Parse Line:1
Line:220 HK2PR04CA0056.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 13 Nov 2017 07:02:38 +0000
11/13/17 12:32:01 Begin read state 1
RESP:220 HK2PR04CA0056.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 13 Nov 2017 07:02:38 +0000


11/13/17 12:32:01 1 220 EHLO
11/13/17 12:32:01 newstate 2
CLIENT:EHLO kasun@abansfinance.lk


11/13/17 12:32:01 newstate - before 0 28 0
11/13/17 12:32:01 newstate - after 28 28 28
11/13/17 12:32:01 End read state 2
11/13/17 12:32:06 Number of lines: 2
str:501 5.5.4 Invalid domain name [HK2PR04CA0056.apcprd04.prod.outlook.com]


11/13/17 12:32:06 Parse Line:1
Line:501 5.5.4 Invalid domain name [HK2PR04CA0056.apcprd04.prod.outlook.com]
11/13/17 12:32:06 Begin read state 2
RESP:501 5.5.4 Invalid domain name [HK2PR04CA0056.apcprd04.prod.outlook.com]


11/13/17 12:32:06 2 501 AUTH LOGIN
11/13/17 12:32:06 End read state -1
11/13/17 12:32:06 501 5.5.4 Invalid domain name [HK2PR04CA0056.apcprd04.prod.outlook.com]


11/13/17 12:32:06 End SMTP Session
 

Cecil

17+ years progress programming and still learning.
#6
An alternative is mailsend. Yes, it works with Windows 10 32/64bit ,Linux and Mac:

I have used this with our own Office 365 account

GitHub - muquit/mailsend: A program to send mail via SMTP from command line

Example command line:

Code:
mailsend1.16.exe -smtp smtp.office365.com -port 587 -auth -starttls -user joe.blogs@corpycop.com -pass ToPSeCrute -t customer@bigcorp.com -f no-reply@corpycop.com -sub "Over Due Bill" -attach "invoice.pdf" -mime-type "text/plain" -msg-body "messagebody.txt"
-user = Office 365 account
-pass = Office 365 password
-t = who is it going to.
-f = who is the email from
-sub = "Email Subject title"
-attach = "File attachment"
-mime-type = Mime Type of the Message body
-msg-body = File of the message of the email.*

*It is possible to pipe the TXT of the message body without having to create a file, but for the debuging purpose, it's wise to save a file.