Forum Discussion
LawrenceRB
Mar 09, 2023Copper Contributor
Help with NetX Duo SMTP client example
Hello Azure RTOS community,
I'm new to Azure RTOS development and I'm stuck trying to succeed in setting up the SMTP example.
I'm trying to send an email with my outlook account.
Here are some of the settings I can share:
#define USERNAME "email address removed for privacy reasons"
#define PASSWORD "mypasssword"
#define FROM_ADDRESS "email address removed for privacy reasons"
#define RECIPIENT_ADDRESS "email address removed for privacy reasons"
#define LOCAL_DOMAIN "smtp.office365.com"
#define SUBJECT_LINE "NetX SMTP Client Demo"
#define MAIL_BODY "NetX SMTP client is a simple SMTP client implementation \r\n" \
"that allow embedded devices to send email to an SMTP server. \r\n" \
"This feature is intended to allow a device to send simple status\r\n " \
"reports using the most universal Internet application, email.\r\n"
Now for the Auth settings I'm trying with:
/* See the NetX SMTP Client User Guide for how to set the authentication type.
The most common authentication type is PLAIN. */
#define CLIENT_AUTHENTICATION_TYPE NX_SMTP_CLIENT_AUTH_LOGIN
#define SERVER_IP_ADDRESS IP_ADDRESS(52,97,11,226)
#define SERVER_PORT 587
I'm proceeding onto the Azure IoT main example, as it stablished full conectivity with IP and TLS.
So I sneaked in the Client Initializations as following:
status = nxd_smtp_client_create(&demo_client, &nx_ip, &nx_pool,
USERNAME,
PASSWORD,
FROM_ADDRESS,
LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE,
&server_ip_address, SERVER_PORT);
Which returns Success but when I try sending:
status = nx_smtp_mail_send(&demo_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL,
SUBJECT_LINE, MAIL_BODY, sizeof(MAIL_BODY) - 1);
It returns the error code 0xAD, which stands for:
/* Error in response to Client SMTP AUTH command */
Can someone give me a hand?
No RepliesBe the first to reply