1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

win32/sendmail.c/SendText(): move posting of DATA prior to stripped header computation

Removes some error handling and work if it fails
This commit is contained in:
Gina Peter Banyard
2025-12-26 01:21:56 +01:00
parent 004c630106
commit 8aa64bb976

View File

@@ -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);