Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer(true);
- $mail->IsSMTP();
- $mail->Host = SMTP_HOST;
- $mail->Port = 465;
- //$mail->SMTPDebug = 2;
- $mail->SMTPDebug = false;
- $mail->SMTPSecure = 'ssl';
- $mail->SMTPAuth = true;
- $mail->Username = SMTP_USERNAME;
- $mail->Password = SMTP_PASSWORD;
- $mail->AddAddress($_POST['email'],"Main Recipient");
- $mail->SetFrom("do-not-reply@cxxxxx.xx.xx", "xxxxx Email");
- $mail->Subject = ('Enquiry of '.$_POST['firstName'].' From website');
- if($displayData["location"])
- $mail->AddAttachment($displayData["location"], $displayData["filename"]);
- $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';
- $mail->Body = $message;
- $mail->MsgHTML($mail->Body);
- if(!$mail->Send()){
- return 0;
- } else{
- return 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement