mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 07:18:08 +02:00
Fix for various smtp issues reported in bugtracker
git-svn-id: file:///svn/phpbb/trunk@2295 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -153,7 +153,7 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
|
|||||||
|
|
||||||
// From this point onward most server response codes should be 250
|
// From this point onward most server response codes should be 250
|
||||||
// Specify who the mail is from....
|
// Specify who the mail is from....
|
||||||
fputs($socket, "MAIL FROM: " . $board_config['board_email'] . "\r\n");
|
fputs($socket, "MAIL FROM: <" . $board_config['board_email'] . ">\r\n");
|
||||||
server_parse($socket, "250");
|
server_parse($socket, "250");
|
||||||
|
|
||||||
// Specify each user to send to and build to header.
|
// Specify each user to send to and build to header.
|
||||||
@@ -165,9 +165,9 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
|
|||||||
// Add an additional bit of error checking to the To field.
|
// Add an additional bit of error checking to the To field.
|
||||||
//
|
//
|
||||||
$mail_to_address = trim($mail_to_address);
|
$mail_to_address = trim($mail_to_address);
|
||||||
if ( preg_match('/.+\@.+/', $mail_to_address) )
|
if ( preg_match('/[^ ]+\@[^ ]+/', $mail_to_address) )
|
||||||
{
|
{
|
||||||
fputs( $socket, "RCPT TO: $mail_to_address\r\n" );
|
fputs( $socket, "RCPT TO: <$mail_to_address>\r\n" );
|
||||||
server_parse( $socket, "250" );
|
server_parse( $socket, "250" );
|
||||||
}
|
}
|
||||||
$to_header .= "<$mail_to_address>, ";
|
$to_header .= "<$mail_to_address>, ";
|
||||||
@@ -180,9 +180,9 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
|
|||||||
// Add an additional bit of error checking to bcc header...
|
// Add an additional bit of error checking to bcc header...
|
||||||
//
|
//
|
||||||
$bcc_address = trim( $bcc_address );
|
$bcc_address = trim( $bcc_address );
|
||||||
if ( preg_match('/.+\@.+/', $bcc_address) )
|
if ( preg_match('/[^ ]+\@[^ ]+/', $bcc_address) )
|
||||||
{
|
{
|
||||||
fputs( $socket, "RCPT TO: $bcc_address\r\n" );
|
fputs( $socket, "RCPT TO: <$bcc_address>\r\n" );
|
||||||
server_parse( $socket, "250" );
|
server_parse( $socket, "250" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -193,9 +193,9 @@ function smtpmail($mail_to, $subject, $message, $headers = "")
|
|||||||
// Add an additional bit of error checking to cc header
|
// Add an additional bit of error checking to cc header
|
||||||
//
|
//
|
||||||
$cc_address = trim( $cc_address );
|
$cc_address = trim( $cc_address );
|
||||||
if ( preg_match('/.+\@.+/', $cc_address) )
|
if ( preg_match('/[^ ]+\@[^ ]+/', $cc_address) )
|
||||||
{
|
{
|
||||||
fputs($socket, "RCPT TO: $cc_address\r\n");
|
fputs($socket, "RCPT TO: <$cc_address>\r\n");
|
||||||
server_parse($socket, "250");
|
server_parse($socket, "250");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user