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
What is php how it works?
How to execute an sql query?
What is the difference between print() and echo() in PHP?
How to close a session properly?
What is the difference between rest and soap?
Can we override static method?
What is a session in php?
How can you declare the array in php?
What is the use of the function 'imagetypes()'?
Is gender a dependent variable?
How to redirect https to http url and vice versa in .htaccess?
Tell me what should we do to be able to export data into an excel file?
How to upload file in php?
What is difference between sql and php?
How to pass variables by references?