Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('../includes/phpmailer/class.phpmailer.php');
- $dirName = dirname(__FILE__);
- $filePath = "{$dirName}/templates/sample-financial-plan.pdf";
- $fileName = basename($filePath);
- $fileType = mime_content_type($filePath);
- $from_name="Getting You Rich Support Team";
- $to_name = "Dhruvenkumar Shah";
- $fname = "Dhruvenkumar";
- $lname = "Shah";
- $phone = "1234567890";
- $body = <<<BODY
- <html>
- <head>
- </head>
- <body>
- <div>
- $lname $fname $phone
- </div>
- </body>
- </html>
- BODY;
- $mail = new PHPMailer();
- $mail->From = $from;
- $mail->FromName = $from_name;
- $mail->AddAddress($to, $to_name);
- $mail->AddReplyTo($from, $from_name);
- $mail->AddAttachment($filePath);
- $mail->IsHTML(true);
- $mail->Body = $body;
- $mail->Subject = 'Your Sample Financial Plan';
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message sent!";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment