edywladson /
sendmail
| 1 | <?php |
||||
| 2 | require __DIR__ . "/../vendor/autoload.php"; |
||||
| 3 | |||||
| 4 | use EdyWladson\SendMail\SendMail; |
||||
| 5 | |||||
| 6 | //Config |
||||
| 7 | $sendmail = new SendMail( |
||||
| 8 | "Host", |
||||
| 9 | "Port", |
||||
| 10 | "User", |
||||
| 11 | "Pass", |
||||
| 12 | "Lang", //default "en" |
||||
| 13 | "Secure", //default "tls" |
||||
| 14 | "Charset", //default "utf-8" |
||||
| 15 | "Html", //default "true" |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 16 | "Auth", //defautl "true" |
||||
|
0 ignored issues
–
show
'Auth' of type string is incompatible with the type boolean expected by parameter $mail_auth of EdyWladson\SendMail\SendMail::__construct().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 17 | ); |
||||
| 18 | |||||
| 19 | //Mail Data |
||||
| 20 | $sendmail->mail( |
||||
| 21 | "Subject", |
||||
| 22 | "Body", |
||||
| 23 | "Recipient Mail", |
||||
| 24 | "Recipient Name" |
||||
| 25 | ); |
||||
| 26 | |||||
| 27 | //Test and Result |
||||
| 28 | if (!$sendmail->send("From Mail", "From Name")) { |
||||
| 29 | echo $sendmail->message(); |
||||
| 30 | } else { |
||||
| 31 | echo "Email successfully sent!"; |
||||
| 32 | } |
||||
| 33 |