Sample Code : Sending mail via PHP
You can use PHPMailer to send mails via PHP. To use this open source object you need to download two php class files which can be found here and upload them into your project include folder first.
Here's a complex example of sending an HTML email with SMTP authentication and attachments
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "email@example.com"; // SMTP username
$mail->Password = "youremailpassword"; // SMTP password
$mail->From = "firstname.lastname@example.org";
$mail->FromName = "Your Name";
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("Path to Attachment "); // attachment
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML body";
$mail->AltBody = "This is the text-only body";
echo "Message was not sent
echo "Mailer Error: " . $mail->ErrorInfo;
echo "Message has been sent";
Was this answer helpful?
Register_Globals directive is set to OFF because of potential security issues. PHP has this...
The path is : #!/usr/bin/perl However! This is not require on the Windows platform, it is a Unix...