
-40-
v4.9
SMTP and POP3 related functions
8. SMTP and POP3 related functions
Note:
to use these features the email servers must work without SSL function.
8.1. Sending email with SMTP
8.1.1. Setting the SMTP server
This function set SMTP server address and server’s port number. SMTP client will initiate TCP session with the specified server to
send an e-mail. If SMTP server requires authentication the function must have the user_name and the password. If the process
of sending an e-mail is ongoing, the function returns -1 directly.
Example of use:
{
// Sets the SMTP server without authentication :
setSMTPserver(“smtp.server.com”, 110,);
// Sets the SMTP server with authentication :
setSMTPserver(“smtp.server.com”, 110, “user_name”, “password”);
}
This function returns:
•
‘1’ if success
•
‘0’ if error setting username and password
•
‘-1’ if error setting server and port
8.1.2. Setting the sender address and name
This function sets the sender mail address and name.
{
// Sets the sender mail address and the name:
setSMTPfrom(“[email protected]”, “sender”);
}
This function returns:
•
‘1’ if success
•
‘0’ if error
8.1.3. Setting the recipient address and name
The function
setSMTPrecipient(kind, index, mail_address, name)
sets the recipient mail address and name. For set
a normal recipient
kind
parameter must be 0, 1 for Carbon Copy recipient and 2 for Blind Carbon Copy recipient. The 3G/GPRS
module allows five recipients of each kind (
index
from 0 to 4).
{
// Sets a normal recipient:
setSMTPrecipient(0, 0, [email protected], normal_recicpient);
// Sets a Carbon Copy recipient:
setSMTPrecipient(1, 2, [email protected], Carcon_Copy_recicpient);
// Sets a normal recipient:
setSMTPrecipient(2, 4, [email protected],
Blind_Carbon_Copy_recicpient);
}
This function returns:
•
‘1’ if success
•
‘0’ if error
Содержание Waspmote 3G Plus GPS
Страница 1: ...Waspmote 3G GPS Networking Guide ...