So let,s see how to submit PHP EMAIL, Plain-Text Email in PHP
First you should know about the basic email functionality in PHP,
you simply need some steps to be added in the email function something like below
$to = “firstname.lastname@example.org”;$subject = “Verify Your Email”;$message = “This is a message for you!”;$from = “email@example.com”;mail($to,$subject,$message,$from);
Above local variables hold some information and then we use the PHP, Email function easily. So, if you want to send a beautiful HTML & CSS formatted (Email) then you do so. Carry on reading.
Sending PHP Email with HTML & CSS Easily
You can use extra headers to send an email which contains HTML and CSS codes, and this will be actually applied on the page.
Now below is the some code which you can take from here and can use in your site-projects, this will send the email to the user which is in the $to variable, and the email will be fully designed.
///////////------My Blogger Tools--------////////////$to = “firstname.lastname@example.org;$subject = “Verify your email address.”;$message = ”<html>Hello <strong>John Doe</strong><h2>We are a company here in the USA</h2><marquee>We do business with clients</marquee><h3 style=’color:read;’>We welcome you to our website</h3></html>“;// Always 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: <email@example.com>‘ . “\r\n”;mail($to,$subject,$message,$headers);///////////------My Blogger Tools--------////////////
Above email is the perfect one with HTML and CSS (Web or blog) tags, you can change it according to your own information.
But the important part in above email "syntax" is the ($headers variable) in which we’ve defined the version and content with character & set. So this format will be treated as HTML email by the browser and email provider.
You also can change the (from:<firstname.lastname@example.org>) to your own email from which you want to send an email to someone.
If you have any questions about this tutorial or any other tutorial on this website then don’t hesitate to ask your question using below commenting area below this posts Thanks!