Hi all. I have problen with simple email client on renesas. nx_smtp_mail_send function return me 173 error (DEC) which not NetX error actually my code:
#include "nx_api.h"
#include "nx_ip.h"
#include "nx_smtp_client.h"
/* New Thread entry function */
#define USERNAME "user@gmail.com"
#define PASSWORD "userpass"
#define FROM_ADDRESS "user@gmail.com"
#define RECIPIENT_ADDRESS "recipient@gmail.com"
#define LOCAL_DOMAIN "gmail.com"
#define SUBJECT_LINE "NetX SMTP Client Demo"
#define MAIL_BODY "NetX SMTP client is an SMTP client \r\n" \
"implementation for embedded devices to send \r\n" \
"email to SMTP servers. This feature is \r\n" \
"intended to allow a device to send simple \r\n " \
"status reports using the most universal \r\n " \
"Internet application, email.\r\n"
#define CLIENT_AUTHENTICATION_TYPE 3
#define CLIENT_IP_ADDRESS IP_ADDRESS(1,2,3,4)
#define SERVER_IP_ADDRESS IP_ADDRESS(64,233,166,28)
#define SERVER_PORT 25
NX_PACKET_POOL ip_packet_pool;
NX_PACKET_POOL client_packet_pool;
NX_IP client_ip;
static NX_SMTP_CLIENT smtp_client;
void new_thread0_entry(void)
{
UINT status;
UINT error_counter = 0;
ULONG server_ip_address;
server_ip_address = SERVER_IP_ADDRESS;
status = nx_tcp_enable(&g_IP_INST);
status = nx_smtp_client_create(&smtp_client, &g_IP_INST, &g_packet_pool0, USERNAME, PASSWORD, FROM_ADDRESS, LOCAL_DOMAIN, CLIENT_AUTHENTICATION_TYPE, server_ip_address, SERVER_PORT);
if (NX_SUCCESS != status)
{
while(1);
}
status = nx_smtp_mail_send(&smtp_client, RECIPIENT_ADDRESS, NX_SMTP_MAIL_PRIORITY_NORMAL, SUBJECT_LINE, MAIL_BODY, strlen(MAIL_BODY));
if (NX_SUCCESS != status)
{
while(1);
}
status = nx_smtp_client_delete(&smtp_client);
if (NX_SUCCESS != status)
{
while(1);
}
while (1)
{
tx_thread_sleep(10000);
}
}