9 |
This is a test of PHPMailer.
10 |
11 |

12 |
13 |
This example uses HTML.
14 |
Chinese text: 郵件內容為空
15 |
Russian text: Пустое тело сообщения
16 |
Armenian text: Հաղորդագրությունը դատարկ է
17 |
Czech text: Prázdné tělo zprávy
18 |
Emoji: 😂 🦄 💥 📤 📧
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/vendor/phpmailer/phpmailer/examples/exceptions.phps:
--------------------------------------------------------------------------------
1 | setFrom('from@example.com', 'First Last');
14 | //Set an alternative reply-to address
15 | $mail->addReplyTo('replyto@example.com', 'First Last');
16 | //Set who the message is to be sent to
17 | $mail->addAddress('whoto@example.com', 'John Doe');
18 | //Set the subject line
19 | $mail->Subject = 'PHPMailer Exceptions test';
20 | //Read an HTML message body from an external file, convert referenced images to embedded,
21 | //and convert the HTML into a basic plain-text alternative body
22 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
23 | //Replace the plain text body with one created manually
24 | $mail->AltBody = 'This is a plain-text message body';
25 | //Attach an image file
26 | $mail->addAttachment('images/phpmailer_mini.png');
27 | //send the message
28 | //Note that we don't need check the response from this because it will throw an exception if it has trouble
29 | $mail->send();
30 | echo "Message sent!";
31 | } catch (phpmailerException $e) {
32 | echo $e->errorMessage(); //Pretty error messages from PHPMailer
33 | } catch (Exception $e) {
34 | echo $e->getMessage(); //Boring error messages from anything else!
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/phpmailer/phpmailer/examples/gmail.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
17 |
18 | //Enable SMTP debugging
19 | // 0 = off (for production use)
20 | // 1 = client messages
21 | // 2 = client and server messages
22 | $mail->SMTPDebug = 2;
23 |
24 | //Ask for HTML-friendly debug output
25 | $mail->Debugoutput = 'html';
26 |
27 | //Set the hostname of the mail server
28 | $mail->Host = 'smtp.gmail.com';
29 | // use
30 | // $mail->Host = gethostbyname('smtp.gmail.com');
31 | // if your network does not support SMTP over IPv6
32 |
33 | //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
34 | $mail->Port = 587;
35 |
36 | //Set the encryption system to use - ssl (deprecated) or tls
37 | $mail->SMTPSecure = 'tls';
38 |
39 | //Whether to use SMTP authentication
40 | $mail->SMTPAuth = true;
41 |
42 | //Username to use for SMTP authentication - use full email address for gmail
43 | $mail->Username = "username@gmail.com";
44 |
45 | //Password to use for SMTP authentication
46 | $mail->Password = "yourpassword";
47 |
48 | //Set who the message is to be sent from
49 | $mail->setFrom('from@example.com', 'First Last');
50 |
51 | //Set an alternative reply-to address
52 | $mail->addReplyTo('replyto@example.com', 'First Last');
53 |
54 | //Set who the message is to be sent to
55 | $mail->addAddress('whoto@example.com', 'John Doe');
56 |
57 | //Set the subject line
58 | $mail->Subject = 'PHPMailer GMail SMTP test';
59 |
60 | //Read an HTML message body from an external file, convert referenced images to embedded,
61 | //convert HTML into a basic plain-text alternative body
62 | $mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
63 |
64 | //Replace the plain text body with one created manually
65 | $mail->AltBody = 'This is a plain-text message body';
66 |
67 | //Attach an image file
68 | $mail->addAttachment('images/phpmailer_mini.png');
69 |
70 | //send the message, check for errors
71 | if (!$mail->send()) {
72 | echo "Mailer Error: " . $mail->ErrorInfo;
73 | } else {
74 | echo "Message sent!";
75 | }
76 |
--------------------------------------------------------------------------------
/vendor/phpmailer/phpmailer/examples/gmail_xoauth.phps:
--------------------------------------------------------------------------------
1 | isSMTP();
21 |
22 | //Enable SMTP debugging
23 | // 0 = off (for production use)
24 | // 1 = client messages
25 | // 2 = client and server messages
26 | $mail->SMTPDebug = 0;
27 |
28 | //Ask for HTML-friendly debug output
29 | $mail->Debugoutput = 'html';
30 |
31 | //Set the hostname of the mail server
32 | $mail->Host = 'smtp.gmail.com';
33 |
34 | //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
35 | $mail->Port = 587;
36 |
37 | //Set the encryption system to use - ssl (deprecated) or tls
38 | $mail->SMTPSecure = 'tls';
39 |
40 | //Whether to use SMTP authentication
41 | $mail->SMTPAuth = true;
42 |
43 | //Set AuthType
44 | $mail->AuthType = 'XOAUTH2';
45 |
46 | //User Email to use for SMTP authentication - Use the same Email used in Google Developer Console
47 | $mail->oauthUserEmail = "someone@gmail.com";
48 |
49 | //Obtained From Google Developer Console
50 | $mail->oauthClientId = "RANDOMCHARS-----duv1n2.apps.googleusercontent.com";
51 |
52 | //Obtained From Google Developer Console
53 | $mail->oauthClientSecret = "RANDOMCHARS-----lGyjPcRtvP";
54 |
55 | //Obtained By running get_oauth_token.php after setting up APP in Google Developer Console.
56 | //Set Redirect URI in Developer Console as [https/http]://