diff --git a/win32/sendmail.c b/win32/sendmail.c index ea8deadeba5..f8b22897a2c 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -504,6 +504,14 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, const efree(tempMailTo); } + if (!Post("DATA\r\n")) { + return (FAILED_TO_SEND); + } + if ((res = Ack(&server_response)) != SUCCESS) { + SMTP_ERROR_RESPONSE(server_response); + return (res); + } + /* Send mail to all Bcc rcpt's This is basically a rip of the Cc code above. Just don't forget to remove the Bcc: from the header afterwards. */ @@ -578,20 +586,6 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, const } } - if (!Post("DATA\r\n")) { - if (stripped_header) { - efree(stripped_header); - } - return (FAILED_TO_SEND); - } - if ((res = Ack(&server_response)) != SUCCESS) { - SMTP_ERROR_RESPONSE(server_response); - if (stripped_header) { - efree(stripped_header); - } - return (res); - } - /* send message header */ if (Subject == NULL) { res = PostHeader(RPath, "No Subject", mailTo, stripped_header);