Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'PHPMailer/PHPMailerAutoload.php';
- $nome = $_POST["nome"];
- $subject = $_POST["subject"];
- $message = $_POST["message"];
- $email = $_POST["email"];
- $contacto = $_POST["contacto"];
- $body = "<p>Mail recebido de: </p>" . $nome . "<p>Email:</p>" . $email . "<p> Contacto:</p>" . $contacto . "<p>Mensagem:</p>" . $message ;
- $mail = new PHPMailer();
- $mail->CharSet = "text/html; charset=UTF-8;";
- $mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
- $mail->CharSet = 'UTF-8';
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'ssl';
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 587;
- $mail->Username = "the email;
- $mail->Password = the password;
- $mail->SetFrom('the email', 'Organizer');
- $mail->Subject = "[ORÇAMENTO] " . $subject;
- $mail->Body = $body;
- $mail->IsHTML(true);
- $mail->AddAddress("the email");
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- $sucesso = 'Mensagem enviada com sucesso!';
- }
- require '../PHPMailer/PHPMailerAutoload.php';
- $body = "<p>Car(a) " . ${'user' . $i} . ",</p> <p> Foi lhe associado(a) uma nova ocorrência. Consulte-a em http://www.organizer.com.pt . </p>";
- $mail = new PHPMailer();
- $mail->CharSet = "text/html; charset=UTF-8;";
- $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
- $mail->CharSet = 'UTF-8';
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'ssl';
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 587;
- $mail->Username = "the email";
- $mail->Password = the password;
- $mail->SetFrom('the email', 'Organizer');
- $mail->Subject = "Nova Ocorrência";
- $mail->Body = $body;
- $mail->IsHTML(true);
- $mail->AddAddress($email);
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- $sucesso = 'Mensagem enviada com sucesso!';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement