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 php session id unique?
Define urlencode() and urldecode() used in php?
What is the function in PHP do not return a timestamp?
Which operator is used to concatenate two strings in PHP?
Is php 7.0 stable?
Write a program to find a string is palindrome or not?
What is difference between session and cookies in php?
How to download and install php for windows?
How to access a specific character in a string?
iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not
What is use of htmlspecialchars php?
Does php class need constructor?
What are php magic methods?
What is the difference between get and post method in php?
What is meant by variable variables in php?