Send Email with or without attachment by using PHP

These days E-mail is the powerful way of communicating with each other without spending a single buck. If you are  a Php developer and wish to send e-mail by using Php then you are at the right place. Here i am going to tell you how you can send plain text email, HTML email and email with attachment by php email form.

Php have a quite simple mail function to send e-mail. In-fact the function name is ‘mail’. Let me introduce you this function.

mail($to,$subject,$message,$header)

$to : E-mail address of the receiver(Required).

$subject : E-mail subject(Required).

$message : E-mail message body(Required).

$header : for sending additional information like sender email, reply to etc.(Optional)

 

Sending Plain Text mail:-

Use \n for next line.

 

Sending HTML mail:-


From:
7tech.co.in team"; $headers  = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to,$sub,$msg,$headers); ?>

 

Sending HTML mail with Attachment:-

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Privacy Policy · Contact · Sitemap

© 7Tech – Programming and Tech Tutorials