Commit c0519258269ebac7e66e851f6db919d0428948c6
1 parent
1ec2b35d
send test msg from arktika login
Showing
1 changed file
with
42 additions
and
1 deletions
Show diff stats
src/app/tasks/BasketTask.php
@@ -33,7 +33,48 @@ class BasketTask extends \Phalcon\CLI\Task | @@ -33,7 +33,48 @@ class BasketTask extends \Phalcon\CLI\Task | ||
33 | $user = $this->models->getCustomers()->getOneData($user_id); | 33 | $user = $this->models->getCustomers()->getOneData($user_id); |
34 | if (!empty($user[0]['email'])) { | 34 | if (!empty($user[0]['email'])) { |
35 | 35 | ||
36 | - return $user[0]['email']; | 36 | + $email = $user[0]['email']; |
37 | + | ||
38 | + $mail = new PHPMailer(); | ||
39 | + //Tell PHPMailer to use SMTP | ||
40 | + $mail->isSMTP(); | ||
41 | + //Enable SMTP debugging | ||
42 | + // 0 = off (for production use) | ||
43 | + // 1 = client messages | ||
44 | + // 2 = client and server messages | ||
45 | + $mail->SMTPDebug = 0; | ||
46 | + //Ask for HTML-friendly debug output | ||
47 | + $mail->Debugoutput = 'html'; | ||
48 | + //Set the hostname of the mail server | ||
49 | + $mail->Host = 'smtp.gmail.com'; | ||
50 | + $mail->CharSet = 'UTF-8'; | ||
51 | + // use | ||
52 | + // $mail->Host = gethostbyname('smtp.gmail.com'); | ||
53 | + // if your network does not support SMTP over IPv6 | ||
54 | + //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission | ||
55 | + $mail->Port = 587; | ||
56 | + //Set the encryption system to use - ssl (deprecated) or tls | ||
57 | + $mail->SMTPSecure = 'tls'; | ||
58 | + //Whether to use SMTP authentication | ||
59 | + $mail->SMTPAuth = true; | ||
60 | + //Username to use for SMTP authentication - use full email address for gmail | ||
61 | + $mail->Username = "arctic.semenainua@gmail.com"; | ||
62 | + //Password to use for SMTP authentication | ||
63 | + $mail->Password = "arctic0411"; | ||
64 | + | ||
65 | + //Set who the message is to be sent from | ||
66 | + $mail->setFrom('arctic.semenainua@gmail.com', 'semena.in.ua'); | ||
67 | + //Set who the message is to be sent to | ||
68 | + $mail->addAddress($email); | ||
69 | + //Set the subject line | ||
70 | + $mail->Subject = 'test'; | ||
71 | + //Read an HTML message body from an external file, convert referenced images to embedded, | ||
72 | + //convert HTML into a basic plain-text alternative body | ||
73 | + | ||
74 | + $mail->msgHTML('test'); | ||
75 | + $mail->send(); | ||
76 | + | ||
77 | + return 'Sended test msg'; | ||
37 | 78 | ||
38 | } | 79 | } |
39 | 80 |