forked from PHPMailer/PHPMailer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
28 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ require '../vendor/autoload.php'; | |
if (array_key_exists('to', $_POST)) { | ||
$err = false; | ||
$msg = ''; | ||
$email = ''; | ||
//Apply some basic validation and filtering to the subject | ||
if (array_key_exists('subject', $_POST)) { | ||
$subject = substr(strip_tags($_POST['subject']), 0, 255); | ||
|
@@ -55,9 +56,9 @@ if (array_key_exists('to', $_POST)) { | |
$mail->Host = 'localhost'; | ||
$mail->Port = 2500; | ||
$mail->CharSet = 'utf-8'; | ||
//It's important not to use the submitter's address as the form address as it's forgery, | ||
//which will cause our messages to fail SPF checks | ||
//Use an address in your own domain here | ||
//It's important not to use the submitter's address as the from address as it's forgery, | ||
//which will cause your messages to fail SPF checks. | ||
//Use an address in your own domain as the from address, put the submitter's address in a reply-to | ||
$mail->setFrom('[email protected]', (empty($name)? 'Contact form': $name)); | ||
$mail->addAddress($to); | ||
$mail->addReplyTo($email, $name); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters