The sender email address can be anything. This approach somehow hides the sender`s identity. Of course, the actual ip address stays and can not be forged. By any means I do not encourage you to cheat on your recipients. Myself, I really hate spammers and unsolicited messages.
This class can be easily modified for sending messages to multiple recipients.
The message body in this example is just a plain text. Additional program code is required to enable multipart messages and messages with attachments.
* * *
Some SMTP headers can be quite important as, for example, Message-ID header containing unique identifier for the message. Without this one your "Hi dude!" has more chances to be rejected by the recipient POP3 server.
If you are adding your own non-standard headers make sure their names start with "X-". It prevents them from possibly interfering with regular ones.
For each TO: recipient issue RCPT TO: command and include this email address in "To:" SMTP header.
For each CC: recipient issue RCPT TO: command and include this email address in "Cc:" SMTP header.
For each BCC: recipient issue RCPT TO: command only, not include this email address in "Cc:" SMTP header.
* * *
Consider using the setsockopt function to adjust the buffer space used for the sending (the default value is 8192 bytes). Because of this, the large message bodies must be chopped and sent by chunks.
Hi, i encountered error here. it says "authentication required" , im using the yahoo business smtp. can you help me on this. thank a lot
email@example.com | 2007-10-02 04:04:49
I am trying to send email through an exchange server. Can I use this application to do so. I have tried specifying the email address and the exchange server in the INIT procedure but it doesnt like it.
A.M. | 2007-10-02 12:45:38
An exchange server may require outgoing smtp authentication. Unfortunately, this code sample does not cover this issue.
Garry Bettle | 2007-10-17 12:36:52
I've recently setup Blat to use smtp.gmail.com
Gmail requires authentication, but Blat can't do that.
But with Stunnel (http://www.stunnel.org/), a universal SSL Wrapper, I've successfully got it working.
Perhaps this example could work with authentication if it used Stunnel.
A.M. | 2007-10-17 13:21:24
I was able to make the lightest SMTP AUTH, which is the PLAIN, work with a similar VFP code.
Gmail probably requires more advanced auth modes as well as encrypted data exchange. Using that universal SSL Wrapper seems to be very reasonable idea.