Hi,
I am hosting my domain using the Personal package Plan. I have an e-greeting section also hosted there. For users to be able to send cards, obviously we need the mail option. With the 'mail' function, I am able to do so, however, from the FAQ, I understand that either the 'From' or 'To' header need to have an email id from the hosted domain. My questions:
Question 1
If I use STMP, is this still required? However, when I try to use SMTP, I am getting the following error:
Message was not sent
Mailer Error: SMTP Error: Could not authenticate
I have used the following code:
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "ws5.100ws.com"; // SMTP servers
$mail->Port = 25;
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "card-notify@jai-world.com"; // SMTP username
$mail->Password = "********"; // SMTP password
$mail->From = "from@test.com";
$mail->FromName = "Mailer";
$mail->AddAddress("test@test.com", "Test");
$mail->AddReplyTo("info@site.com","Information");
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
Is there anything wrong in here?
Question 2
Is there any way I can use both the From and To address the user provides? The from address I provide doesn't look nice. (When you sent e-cards from most of the greeting card sites, the from address is the actual address and not the site's email id).
Any help is greatly appreciated.
BTW... ur forum is great!!!!
Thanks
jai