Tag Archives: Importance For Your Business

PHP Mail Function

Send Mail in PHP

PHP provides inbuilt function known as mail() function which allow you to send mail directly from your program. This function returns TRUE on success and FALSE when failed. Mail function accept 5 parameters like to, subject, message, headers and  extra parameters.

Syntax
mail(to,subject,message,headers,parameters)
Name Required Description
to Yes Mail Address of the receiver or receivers
subject Yes Subject of the mail content.
message Yes Mail message. This can either be plain text or HTML formatted mail.
headers No Additional headers can be From, Cc, and Bcc etc.
parameters No Additional parameter to the send mail program.

PHP Simple Mail Function

The following example will send simple text mail.

<?php
$to = "receiver@domain.com";
$subject = "This is a test mail";
$message = "Hi! This is a simple text mail to test";
$from = "sender@a2zwebhelp.com";
$headers = "From:" . $from;
$result = mail($to,$subject,$message,$headers);
if($result==true){
   echo "Mail Sent successfully.";
}
?>

PHP Send Mail With CC and BCC

<?php
$to = "receiver@domain.com";
$cc = "CCto@domain.com";
$bcc = "BCCto@domain.com";
$subject = "This is a test mail with CC and BCC";
$message = "Hi! This is a simple text mail to test with CC and BCC";
$from = "sender@a2zwebhelp.com";
$headers = "From:" . $from . "\r\n";
$headers .= "CC:" . $cc . "\r\n";
$headers .= "BCC:" . $bcc. "\r\n";
$result = mail($to,$subject,$message,$headers);
if($result==true){
   echo "Mail Sent successfully.";
}
?>

PHP Send HTML Mail

<?php
$to = "receiver@domain.com";
$cc = "CCto@domain.com";
$bcc = "BCCto@domain.com";
$subject = "This is a test mail with CC and BCC";
$from = "sender@a2zwebhelp.com";
$message = "<table border="0" width="100%" cellspacing="0" cellpadding="0" 
style="font-family: Verdana; font-size: 8pt">
<tr>
<td colspan="2" align="center" height="40"><b>Simple HTML Mail</b></td>
</tr>
<tr>
<td height="25" width="10%">&nbsp;</td>
<td height="25">Mail content goes here. </td>
</tr>
<tr>
<td height="25" width="10%">&nbsp;</td>
<td height="25">Mail second line goes here.</td>
</tr>
</table>";
// Set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

$headers .= "From:" . $from . "\r\n";
$headers .= "CC:" . $cc . "\r\n";
$headers .= "BCC:" . $bcc. "\r\n";
$result = mail($to,$subject,$message,$headers);
if($result==true){
   echo "Mail Sent successfully.";
}
?>

Send mail with attachment

Click here to know how to send mail with attachment.

HTML Attributes

Many HTML tags have a unique set of their own attributes. These attributes are divided into core attributesinternationalization attributes, and scripting events. Attributes are always specified in the start tag and come in name/value pairs like: name=”value”

Example

<a href="http://www.a2zwebhelp.com">Link to my website.</a>
<p id="firstp">This is my first paragraph.</p>
<h2 align="center" title="center text">Centered Heading</h2>

HTML Attributes with category

Category Attributes Name
Core Attributes id <p id=”myid”>My Text.</p>
class <div clsss=”newclass”> Text </div>
name <form name=”arup”></form>
style <span style=”font-family: arial”> Arial</span>
title <h1 title=”Heading”> Heading </h1>
alt <img src=”” alt=”my image”>
align <p align=”left”></p>
valign <td valign=”top”>&nbsp;</td>
bgcolor <td bgcolor=”#808080″>&nbsp;</td>
background <td background=”filepath”>&nbsp;</td>
width <img width=”100px”>
height <img width=”100px” height=”100px”>
Internationalization Attributes LANG <span lang=en>Welcome</span>
DIR
Common Scripting Events ONCLICK mouse button is clicked on an element.
ONDBLCLICK mouse button is double-clicked on an element
ONMOUSEDOWN mouse button is pressed over an element
ONMOUSEUP mouse button is released over an element
ONMOUSEOVER mouse is moved onto an element
ONMOUSEMOVE mouse is moved while over an element
ONMOUSEOUT mouse is moved away from an element
ONKEYPRESS a key is pressed and released over an element
ONKEYDOWN a key is pressed down over an element
ONKEYUP a key is released over an element

Graphic Design and Multimedia

“IWCn is fully aware of the importance of a relevant advertising strategy. “

FULLY INTEGRATED

IWCn is first and foremost a creative, youthful and dynamic multimedia Solution company, fully aware of the importance of a relevant advertising strategy. Fully integrated into a competitive advertising cluster, our company puts its talent and savoir-faire to work for your corporate and brand identity, website design and Logo Design. Here at IWCn we make you look good. We offer graphic design in a holistic approach to the branding of your company.

Continue reading