Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- //Make sure that the input come from a posted form. Otherwise quit immediately
- if ($_SERVER["REQUEST_METHOD"] <> "POST")
- die("You can only reach this page by posting from the html form");
- //error_reporting(E_ALL);
- error_reporting(E_STRICT);
- date_default_timezone_set('America/Toronto');
- include("class.phpmailer.php");
- //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
- $mail = new PHPMailer();
- $ipAdd = $_SERVER["REMOTE_ADDR"];
- $name = $_REQUEST['name'];
- $taikhoan = $_REQUEST['taikhoan'];
- $email = $_REQUEST['email'];
- $mailTo = 'acclp.003@gmail.com';
- $receiver = 'Support Team';
- $subj = $_REQUEST["subject"];
- $mess = $_REQUEST['message'];
- $captcha = $_SESSION["security_code"];
- $body = "<p>"
- . "<fieldset style='border:1px solid #afe14c;margin: 5px 0;padding: 20px 10px'>"
- ."<legend style='font: 700 14px Arial, Helvetica, sans-serif;padding: 0 5px;margin: 0 10px;color: #73b304'>Thông tin</legend>"
- . "+ Tài khoản: <b>".$taikhoan."</b><br><br>"
- . "+ Họ tên: <b>".$name."</b><br><br>"
- . "+ Email: <b>".$email."</b><br><br>"
- . "+ Địa chỉ Ip: <b><a href=\"http://www.ip-adress.com/ip_tracer/".$ipAdd."\" target=\"_blank\">".$ipAdd."</a></b><br>"
- ."</fieldset>"
- . "<fieldset style='border:1px solid #afe14c;margin: 5px 0;padding: 20px 10px'>"
- ."<legend style='font: 700 14px Arial, Helvetica, sans-serif;padding: 0 5px;margin: 0 10px;color: #73b304'>Nội dung</legend>"
- .$mess
- ."</fieldset>"
- ."</p>";
- $body = eregi_replace("[\]",'',$body);
- $mail->CharSet = 'utf-8';
- $mail->IsSMTP();
- $mail->SMTPAuth = true; // enable SMTP authentication
- //$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
- $mail->Host = "smtp.sendgrid.net"; // sets GMAIL as the SMTP server
- $mail->Port = 25; // set the SMTP port for the GMAIL server
- $mail->Username = "azdigi_huytran"; // GMAIL username
- $mail->Password = "azdigihuytran123"; // GMAIL password
- //$mail->AddReplyTo("","First Last");
- //$mail->From = "";
- $mail->FromName = $name;
- $mail->Subject = $subj;
- //$mail->Body = "Hi,<br>This is the HTML BODY<br>"; //HTML Body
- //$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
- $mail->WordWrap = 50; // set word wrap
- $mail->MsgHTML($body);
- $mail->AddAddress($mailTo, $receiver);
- //$mail->AddAttachment("img/t_c.gif"); // attachment
- $mail->IsHTML(true); // send as HTML
- sleep(1);
- if($_REQUEST["spamcheck"] <> $captcha){
- echo "errorCode";
- }
- else{
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo("sended");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement