Send Email PHP Function

Ever find yourself typing the headers into the php mail() function over and over again?

Try using a standard function and calling it when you need to send mail.

function sendEmail($subject,$content,$from,$to){
  $header = "Content-Type: text/html; charset=iso-8859-1\nFrom:$from";
  if( mail($to, $subject, $content, $header) );
}
Tags:
0 0 vote
Article Rating
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Giri Sangha
9 years ago

Smoked for 29 years.