SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | require("/home/c/cm13906/public_html/testingphpmailer/PHPMailer_5.2.0/class.phpmailer.php"); | |
3 | ||
4 | $mail = new PHPMailer(); | |
5 | ||
6 | $mail->IsSMTP(); // set mailer to use SMTP | |
7 | $mail->Host = "smtp.timeweb.ru"; // specify main and backup server | |
8 | $mail->SMTPAuth = "true"; // turn on SMTP authentication | |
9 | - | $mail->SMTPSecure = "tls"; |
9 | + | $mail->SMTPSecure = "ssl"; |
10 | - | $mail->Port = "25"; |
10 | + | $mail->Port = 465; |
11 | $mail->Username = "send@cm13906.tmweb.ru"; // SMTP username | |
12 | $mail->Password = "Thisisafakepassword"; // SMTP password | |
13 | ||
14 | $mail->From = "send@cm13906.tmweb.ru"; | |
15 | $mail->FromName = "Alexey Trubchaninov"; | |
16 | ||
17 | $mail->AddAddress("recieve@cm13906.tmweb.ru"); // name is optional | |
18 | ||
19 | ||
20 | $mail->WordWrap = 50; // set word wrap to 50 characters | |
21 | $mail->IsHTML(true); // set email format to HTML | |
22 | ||
23 | $mail->Subject = "Delivery Request"; | |
24 | $mail->Body = "Hello, this is a test"; | |
25 | $mail->AltBody = "Test"; | |
26 | ||
27 | if(!$mail->Send()) | |
28 | { | |
29 | echo "Message could not be sent. <p>"; | |
30 | echo "Mailer Error: " . $mail->ErrorInfo; | |
31 | exit; | |
32 | } | |
33 | ||
34 | echo "Message has been sent"; | |
35 | ?> |