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
1 changed file
with
10 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
* Again, the way you name your chain file is up to you. You will be also asked for the Import Password. | ||
* | ||
* | ||
* STEP 3 - Code (most of the code is copied from the mail.phps example) | ||
* STEP 3 - Code | ||
*/ | ||
|
||
require '../PHPMailerAutoload.php'; | ||
|
@@ -59,21 +59,22 @@ $mail->addAddress('[email protected]', 'John Doe'); | |
//Set the subject line | ||
$mail->Subject = 'PHPMailer mail() test'; | ||
//Read an HTML message body from an external file, convert referenced images to embedded, | ||
//convert HTML into a basic plain-text alternative body | ||
//Convert HTML into a basic plain-text alternative body | ||
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__)); | ||
//Replace the plain text body with one created manually | ||
$mail->AltBody = 'This is a plain-text message body'; | ||
//Attach an image file | ||
$mail->addAttachment('images/phpmailer_mini.png'); | ||
|
||
//signing the email | ||
$mail->sign('/path/to/cert.crt', //the location of your certificate file | ||
'/path/to/cert.key', //the location of your private key file | ||
'yourSecretPrivateKeyPassword', //the password you protected your private key with (may be empty but parameter can not mit omitted!) | ||
'/path/to/certchain.pem'); //the location of your chain file | ||
//!!!! yourSecretPrivateKeyPassword is not the Import Password !!!! | ||
//Configure message signing (the actual signing does not occur until sending) | ||
$mail->sign( | ||
'/path/to/cert.crt', //The location of your certificate file | ||
'/path/to/cert.key', //The location of your private key file | ||
'yourSecretPrivateKeyPassword', //The password you protected your private key with (not the Import Password! may be empty but parameter must not be omitted!) | ||
'/path/to/certchain.pem' //The location of your chain file | ||
); | ||
|
||
//send the message, check for errors | ||
//Send the message, check for errors | ||
if (!$mail->send()) { | ||
echo "Mailer Error: " . $mail->ErrorInfo; | ||
} else { | ||
|