Mail problems

BlitzPlus Forums/BlitzPlus Programming/Mail problems

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A couple of things:

1) If you send out through your ISP's email server and you try to send to a user at a different ISP, then it's quite likely that your provider requires you to use SMTP Authentication before it will accept mail for delivery from you. Look up the RFC's on how to implement authentication, because if they require it then it's never going to work without it unless you connect directly to the mailserver of the recipient of the email. Which would require you to query the MX record out of the DNS fto find the destination server, AND only works if the destination server doesn't blacklist email originating on a dialup/cable/dsl IP address like many do

2) You should wait after the EHLO and some of the other headers for the server to return the message that it's ready first -- if you simply cram down all the other text, then it might very well ignore it.

3) Also: After the DATA statement you should put the email headers. the mail from: and receipt to: lines are the envelope headers, not the message headers. the from: and to: listed in your email program are the ones AFTER the DATA statement. If you leave them out, many mailservers will simply consider your message spam and trash it.

The proper order:

<connect to mailserver>
(wait for 2xx statement)
EHLO blitzmail (try EHLO first -- if it fails (error 550) THEN fall back to using HELO)
(wait for 2xx code)
MAIL FROM: sender@domain
(wait for 2xx code)
RCPT TO: recipient@domain
(wait for 2xx code)
DATA
(wait for 2xx/3xx code)
FROM: "bob user" <sender@domain>
TO: "joe user" <recipient@domain>
SUBJECT: "Subject Line"
<blank line>
First line of email
Second line of email
<blank>
. (period)
(wait for 2xx code)
QUIT