Tcp4u - SMTP related functions
This function sends a text string using the SMTP protocol such as described by the RFC 821.
- The use of this function requires a previous call to Tcp4uInit().
- Several addressees can be specified into the szTo argument. They should be separated by a semi-colon sign.
- If at least one address is invalid (ie: rejected by the server), the functions returns without sending any data.
- The headers (ie: strings like Reply-To:, Subject:, CC:, ...) should be included at the beginning of the szMessage argument. SmtpSendMessage() only add its X-Mailer: header.
- The function uses the smtp port such as mentioned in the file services. By default, it uses the port 25.
- A successful return code does not warranty the delivery of the message, just that if the delivery fails, the sender will receive a notification.
Syntax: SmtpSendMessage (LPCSTR szFrom,
||The SMTP address of the sender |
||The addressees. They should be separated by semi-colons. |
||The message to be sent. |
||The local SMTP server. |
||The local domain name. If no domain is to be precised, this argument should be set NULL |
||This answer is not mentioned into the RFC |
||Server has closed connection: service unavailable |
||Command not implemented |
||8-bits extension not supported by this server |
||The Server refused the command |
||Tcp4u can not establish a session with the specified server on the smtp port |
||Various network errors |
||The sent command is rejected by the server. Bad arguments. |
||Addressee's mailbox is full |
||User is unknown or address is invalid |
||Message is now managed by the server |
SmtSendMessage ("firstname.lastname@example.org", "email@example.com; firstname.lastname@example.org; me",
"Subject: Hello\r\nHello guys", "smtp.mydomain.net",