Skip to main content

PHPMailer

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php

require_once "class.phpmailer.php";

$mail = new PHPMailer;

$mail->From = "muhammad.kaleem@people.com.pk";
$mail->FromName = "Kaleem People";

$mail->addAddress("muhammad.kaleem@people.com.pk", "Kaleem Add Address Name");

//Provide file path and name of the attachments
//$mail->addAttachment("file.txt", "File.txt");
$mail->addAttachment("file.txt");  
$mail->addAttachment("../images/profile-pic.jpg");
$mail->addAttachment("../report/20090520-074141_sr-march09 dps.pdf"); //Filename is optional

$mail->isHTML(true);

$mail->Subject = "Subject Text Kaleem";
$mail->Body = "<i>Mail body in HTML</i>";
$mail->AltBody = "This is the plain text version of the email content";

if(!$mail->send())
{
    echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
    echo "Message has been sent successfully";
}
?>
</body>
</html>

Comments

Popular posts from this blog

Memoery Managment Problem

http://www.doc.ic.ac.uk/~eedwards/compsys/index.html 1. Given five memory partitions of 100Kb, 500Kb, 200Kb, 300Kb, 600Kb (in order), how would the first-fit, best-fit, and worst-fit algorithms place    processes of 212 Kb, 417 Kb, 112 Kb, and 426 Kb (in order)? Which algorithm makes the most efficient use of memory?  First-fit:  212K is put in 500K partition  417K is put in 600K partition  112K is put in 288K partition (new partition 288K = 500K - 212K)  426K must wait  Best-fit:  212K is put in 300K partition  417K is put in 500K partition  112K is put in 200K partition  426K is put in 600K partition  Worst-fit:  212K is put in 600K partition  417K is put in 500K partition  112K is put in 388K partition  426K must wait  In this example, best-fit turns out to be the best. 2. Assuming a 1 KB page size, what are the page numbers and offsets for the following address refer...

PHP Interview Questions

1.   Which is the latest version of PHP.  The latest stable version of PHP is  5.6.7  released at March 20, 2015 . 2.   Define PHP. PHP is an open source  server side scripting  language used to develop dynamic websites . PHP  stands for Hypertext Preprocessor , also stood for   Personal Home Page .  Now the implementations of PHP is produced by The PHP group .It was created by  Rasmus lerdorf in 1995  . It is a free software released under the PHP license . 3.   Who is the father of PHP. Rasmus Lerdorf known as the father of PHP . Php was created by Rasmus Lerdorf In 1995 . 4.   What is the current version of Apache. The latest  stable version of  Apache  is   2.4.12 , released  on 29th  January  2015. 5.   What is difference between unset and unlink.. Unset is used to delete(destroy) a variable whereas unlink used to delete...