Previous Thread
Next Thread
Print Thread
emailx #15558 27 Sep 07 03:12 AM
Joined: Jun 2001
Posts: 153
O
OmniLedger - Tom Reynolds Offline OP
Member
OP Offline
Member
O
Joined: Jun 2001
Posts: 153
Hi

I'm trying to use emailx to send a batch of emails.

open connection
opflags = 1 + 4

send emails
opflags = 1 + 2

close connection
opflags = 8

When I open connection (I'm not actually sending an email) it works and returns a socket number but also outputs "No 'To' address in EMAILX" to the screen - direct to the screen not via the ERRMSG parameter but to the cursor position.

Re: emailx #15559 27 Sep 07 03:58 AM
Joined: Jun 2001
Posts: 11,945
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,945
Granted, some of the errors that are fatal application errors (i.e. the type that generally only occur when first developing a program, as opposed to things that pop-up at runtime due to environmental issues) get reported directly to the screen.

The error you've got indicates that there is nothing in the EM'TO parameter, i.e. you've haven't specified someone to send the message to.

One bit of confusion with EMAIL protocol that may be responsible for this is that the EM'HEADER also typically contains a "To: so-and-so" clause. But that is more like the addressee info at the top of a letter. It's helpful to the recipient, but no use to the postman since he can only see the address on the outside of the envelope. With the Internet SMTP protocol, the only address that really matters is the one which you pass to EMAILX in the EM'TO parameter.

From the viewpoint of the actual SMTP messages, which you can see in the EMAILX.LOG if you set the LOGLVL (in EMAILX.CFG) high enough, what you pass to EMAILX in the EM'TO parameter actually gets passed to the SMTP service as RCPT TO: ...


Code
28-Feb-07 16:40:57 [EMAIL1-joaquin] > Opening socket mail.pacbell.net (port 25) Flags=1... [Status=0]
28-Feb-07 16:40:57 [EMAIL1-joaquin]   [Socket=5856]
28-Feb-07 16:40:57 [EMAIL1-joaquin] > Checking for data... [Status=1]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Read (flags=0)... [Status=102]
28-Feb-07 16:40:58 [EMAIL1-joaquin] < 220 nlpi001.sbcis.sbc.com ESMTP Sendmail 8.13.8 out.dk.spool/8.13.8; Wed, 28 Feb 2007 18:40:01 -0600
28-Feb-07 16:40:58 [EMAIL1-joaquin] > HELO microsabio.com [Status=21]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=1]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Read (flags=0)... [Status=114]
28-Feb-07 16:40:58 [EMAIL1-joaquin] < 250 nlpi001.sbcis.sbc.com Hello adsl-63-199-106-102.dsl.lsan03.pacbell.net [63.199.106.102], pleased to meet you
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=0]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > MAIL FROM: <return@microsabio.com> [Status=36]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=1]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Read (flags=0)... [Status=48]
28-Feb-07 16:40:58 [EMAIL1-joaquin] < 250 2.1.0 <return@microsabio.com>... Sender ok
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=0]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > RCPT TO: <jack@microsabio.com> [Status=32]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=1]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Read (flags=0)... [Status=49]
28-Feb-07 16:40:58 [EMAIL1-joaquin] < 250 2.1.5 <jack@microsabio.com>... Recipient ok
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=0]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > DATA [Status=6]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=1]
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Read (flags=0)... [Status=50]
28-Feb-07 16:40:58 [EMAIL1-joaquin] < 354 Enter mail, end with "." on a line by itself
28-Feb-07 16:40:58 [EMAIL1-joaquin] > Checking for data... [Status=0]
To: jack mcgregor
Re: test
Reply-To: <replyto@microsabio.com>
X-Mailer: A-Shell EMAILX Version 4.9(113)

  

Re: emailx #15560 27 Sep 07 08:48 PM
Joined: Jun 2001
Posts: 153
O
OmniLedger - Tom Reynolds Offline OP
Member
OP Offline
Member
O
Joined: Jun 2001
Posts: 153
Hi Jack

I knew the EM'TO parameter was empty but I thought from the documentation that I could call EMAILX just to open the connection without actually sending anything?

1. Open connection
"EMF'OPENONLY 4 open only; ignore all but SERVER & HOST"

2. Send emails

3. Close connection.
"EMF'CLOSEONLY 8 close only"

The EMAILX CLOSEONLY call also has nothing in EMF'TO but doesn't return an error.

Even if I've missunderstood the documentation and my use of the EMAILX OPENONLY call is incorrect it still works and I can then send emails using the same socket number - is it necessary to o/p the message to the screen aswell as writing it to the log file? Surely this should be left to the calling program to handle? The basic problem is this message screws-up the screen layout, can it be supressed?

One more observation - when sending emails in step 2. if EM'TO is empty the message is output to the log file but not to the screen.

Re: emailx #15561 28 Sep 07 03:06 AM
Joined: Jun 2001
Posts: 11,945
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,945
These are all valid points. I failed to really grasp what you were trying to do (as usual, I might add). I'm not sure whether the performance savings is sufficient to really justify the extra steps of opening and closing the the SMTP connection independent of the sending of the messages, but since it was me who created those options, I guess it behooves me to make them work properly!!

I'll adjust the code and send you an update by Monday.

Re: emailx #15562 01 Oct 07 04:44 AM
Joined: Jun 2001
Posts: 11,945
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,945
I did some updating of the EMAILX.SBX routine over the weekend, bringing the version up to 5.0(115). (You should have gotten a copy by email.) Let me know if the updates resolve the problem.

As an aside to other EMAILX users: Besides fixing a number of minor bugs related to the above issues, the update now supports one of the most common methods of SMTP authentication. (Needed for SMTP servers that require you to log in before sending messages.) Send me an email if you'd like to update your existing copy.

Re: emailx #15563 03 Oct 07 01:43 AM
Joined: Jun 2001
Posts: 153
O
OmniLedger - Tom Reynolds Offline OP
Member
OP Offline
Member
O
Joined: Jun 2001
Posts: 153
That seems to work fine - thanks.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3