How to send Email using PHP with MySQL in Linux Server?..
Answer Posted / amit srivastava
<?php
include("Mail.php");
/* mail setup recipients, subject etc */
$recipients = "feedback@yourdot.com";
$headers["From"] = "user@somewhere.com";
$headers["To"] = "feedback@yourdot.com";
$headers["Subject"] = "User feedback";
$mailmsg = "Hello, This is a test.";
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = "smtp.mycorp.com";
$smtpinfo["port"] = "25";
$smtpinfo["auth"] = true;
$smtpinfo["username"] = "smtpusername";
$smtpinfo["password"] = "smtpPassword";
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory("smtp", $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
?>
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is null function in php?
Is nan in php?
Where sessions stored in PHP?
What are traits?
Is php fully object oriented?
Why laravel is best php framework?
What is variable and data type?
What is mysqli php?
Tell me is it possible to protect special characters in a query string?
How do you sort an array in php?
Explain me differences between get and post methods?
How do I stop php artisan serve in windows?
How we can declare variable in php?
Where are sessions stored php?
What is php good for?