Skip to content

Instantly share code, notes, and snippets.

@freekrai
Forked from harveytoro/sendCV.php
Created October 23, 2013 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freekrai/7111246 to your computer and use it in GitHub Desktop.
Save freekrai/7111246 to your computer and use it in GitHub Desktop.
<?php
require_once('mailer/class.phpmailer.php');
$myName = "YourName";
$email_pattern = "/^([a-z0-9\.\-\+\_\']+)@[a-z0-9\-\+\_]+\.[a-z0-9\-\+\_]*(\.?)[a-z0-9]+$/";
$email_address = trim($_POST['Body']);
$email = new PHPMailer();
$email->From = 'FromEmail';
$email->AddReplyTo('FromEmail', $myName);
$email->Mailer = 'mail';
$email->Hostname = 'youSpecify';
$email->Sender = 'FromEmail';
$email->FromName = $myName;
$email->Subject = ' CV';
$email->Body = "Hi \n\n My CV is attatched for your convenience, please don't hesitate to contact me with any question. \n\n Kind regards, \n\n ".$myName;
$email->AddAddress($email_address);
$attach = './CV.pdf';
$email->AddAttachment($attach , 'CV.pdf');
if(preg_match($email_pattern, $email_address)){
$email->Send();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment