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 are the advantages of triggers in php?
How are variables declared in php?
Does php support inheritance?
How do I update php?
Why shouldn't I use mysql_* functions in php?
How do you define a constant?
Explain the installation of PHP on UNIX systems?
What does $_env mean?
What is the array in php?
Which is better get or post method?
Explain what does the expression exception::__tostring means?
What is instantiation?
What are the correct and the most two common way to start and finish a PHP block of code?
What u mean by query?
How does php and apache work?