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 use of preg_replace in php?
How to break a file path name into parts?
What is the use of nl2br() in php?
What is difference between rest api and restful api?
Do you have to initialize variables in php?
How many php functions are there?
Is runtime polymorphism overriding?
What is list in PHP?
Why json is used in php?
What is an anti csrf token?
What is session data?
How to send a cookie to the browser?
What is list function with their uses.
Tell me how do you execute a php script from the command line?
Is multiple inheritance supported in php?