Problem sending email using STM32H7
I use NUCLEO-H743ZI board and i have create an http server using RTOS (FreeRTOS API's). My server works good. Now i'm trying to test sending message from a request email to a destination email. I use the functions and definitions based on smtp.c and smtp.h files. This is the section of my code that i use:
/**** send an email using SMTP ****/
void sendAnEmail(void)
{
#define emailFrom "marfourna@yahoo.gr"
#define emailTo "mario.fournaris@gmail.com"
#define emailSubject "annoying"
#define emailMessage "this is an annoying message"
int * some_argument = 0;
//IP address or DNS name for your SMTP connection
smtp_set_server_addr("smtp.mail.yahoo.com"); //if using DNS
//smtp_set_server_addr("8.8.8.8"); //if using IP address
// set both username and password as NULL if no authentication needed
smtp_set_auth("-------","--------);
smtp_set_server_port(465);
smtp_send_mail(emailFrom, emailTo, emailSubject, emailMessage, mySMTPresult,
some_argument);
} //sendAnEmailand this is my handler function for SMTP
//this function is called when SMTP wants to tell us something
void mySMTPresult(void *arg, u8_t smtp_result, u16_t srv_err, err_t err)
{
printf("mail (%p) sent with results: %s, 0x%04x, 0x%08x\n", arg, smtp_result_str(smtp_result), srv_err,err);
} //mySMTPresultThen when i run the program the Lwip Debugger prints this message:
+-+-+-+-+-+-+-+-+-+-+-+-+-+- tcp_input: flags -+-+-+-+-+-+-+-+-+-+-+-+-+-+
tcp_receive: received FIN.
smtp_tcp_recv: connection closed by remote host
mail (00000000) sent with results: SMTP_RESULT_ERR_CLOSED, 0x0000, 0x00000000
This means that the function smtp_send_email() didn't return any error but message didn't send (i don't receive any email from destination email).
There is someone who knows what i do wrong?
Best regards
Mario
