This function sends a text string using the SMTP protocol such as described by the RFC 821.
Notes:
Syntax: SmtpSendMessage (LPCSTR szFrom, LPCSTR szTo, LPCSTR szMessage, LPCSTR szServer, LPCSTR szLocalDomain)
Arguments:
szFrom |
The SMTP address of the sender |
szTo |
The addressees. They should be separated by semi-colons. |
szMessage |
The message to be sent. |
szServer |
The local SMTP server. |
szLocalDomain |
The local domain name. If no domain is to be precised, this argument should be set NULL |
Returns:
SMTP4U_UNEXPECTEDANSWER |
This answer is not mentioned into the RFC |
SMTP4U_SERVICECLOSED |
Server has closed connection: service unavailable |
SMTP4U_NOTIMPLEMENTED |
Command not implemented |
SMTP4U_MIMENOTSUPPORTED |
8-bits extension not supported by this server |
SMTP4U_SERVERCANTEXECUTE |
The Server refused the command |
SMTP4U_CANTCONNECT |
Tcp4u can not establish a session with the specified server on the smtp port |
SMTP4U_DATAERROR |
Various network errors |
SMTP4U_SYNTAXERROR |
The sent command is rejected by the server. Bad arguments. |
SMTP4U_STORAGEEXCEDED |
Addressee's mailbox is full |
SMTP4U_UNKNOWNUSER |
User is unknown or address is invalid |
SMTP4U_SUCCESS |
Message is now managed by the server |
Example : SmtSendMessage ("me@mydomain.net", "ark@foo.net; evan@xyz.net; me", "Subject: Hello\r\nHello guys", "smtp.mydomain.net", "mydomain.net");