|
41 | 41 | * Again, the way you name your chain file is up to you. You will be also asked for the Import Password.
|
42 | 42 | *
|
43 | 43 | *
|
44 |
| - * STEP 3 - Code (most of the code is copied from the mail.phps example) |
| 44 | + * STEP 3 - Code |
45 | 45 | */
|
46 | 46 |
|
47 | 47 | require '../PHPMailerAutoload.php';
|
|
59 | 59 | //Set the subject line
|
60 | 60 | $mail->Subject = 'PHPMailer mail() test';
|
61 | 61 | //Read an HTML message body from an external file, convert referenced images to embedded,
|
62 |
| -//convert HTML into a basic plain-text alternative body |
| 62 | +//Convert HTML into a basic plain-text alternative body |
63 | 63 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
|
64 | 64 | //Replace the plain text body with one created manually
|
65 | 65 | $mail->AltBody = 'This is a plain-text message body';
|
66 | 66 | //Attach an image file
|
67 | 67 | $mail->addAttachment('images/phpmailer_mini.png');
|
68 | 68 |
|
69 |
| -//signing the email |
70 |
| -$mail->sign('/path/to/cert.crt', //the location of your certificate file |
71 |
| - '/path/to/cert.key', //the location of your private key file |
72 |
| - 'yourSecretPrivateKeyPassword', //the password you protected your private key with (may be empty but parameter can not mit omitted!) |
73 |
| - '/path/to/certchain.pem'); //the location of your chain file |
74 |
| - //!!!! yourSecretPrivateKeyPassword is not the Import Password !!!! |
| 69 | +//Configure message signing (the actual signing does not occur until sending) |
| 70 | +$mail->sign( |
| 71 | + '/path/to/cert.crt', //The location of your certificate file |
| 72 | + '/path/to/cert.key', //The location of your private key file |
| 73 | + 'yourSecretPrivateKeyPassword', //The password you protected your private key with (not the Import Password! may be empty but parameter must not be omitted!) |
| 74 | + '/path/to/certchain.pem' //The location of your chain file |
| 75 | +); |
75 | 76 |
|
76 |
| -//send the message, check for errors |
| 77 | +//Send the message, check for errors |
77 | 78 | if (!$mail->send()) {
|
78 | 79 | echo "Mailer Error: " . $mail->ErrorInfo;
|
79 | 80 | } else {
|
|
0 commit comments