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

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...

.NET Interview Question and Answer

Chapter 1: MS-SQL Server Q1. What is Relation in RDBMS? Ans A table in a database is called as relation. Q2. What is Tuple? Ans A Row of a table in database is called as tuple. Q3. What is RDBMS? Ans 1: DBMS is a layer of abstraction between application and database.2:Application interact with the Database via DBMS using Structure Query Language(SQL). 3 : If the database is logically in the form of tables i.e., relation then we call this DBMS as RDBMS. Q4. What is Primary Key? 1: Primary Key is a column of a table which is used to identity a row uniquely.  2: Primary Key cannot have NULL values. 3: Primary Key cannot have duplicate values. Q5. What is Unique Key? ● Unique Key is a column in a table which does not allow duplicate values like primary key. 2: It allows one and only one NULL values. 3: A table can have one and only one primary key. 4: A table can have one or more unique keys. Q6. What is Foreign key? Ans Foreign key is a column of one table wh...