Re: Re: Need help-Send email

From: Date: Sun, 13 Sep 2009 23:40:55 +0000
Subject: Re: Re: Need help-Send email
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-46497@lists.php.net to get a copy of this message
nagendra prasad wrote:
Hi all, Below is the code that I have coded after replies from all of you. But before that I want to thank all of you for your help. I have coded the email code but still it is giving me an error. Please help me.
... and the error is what exactly?
<?php //sending email script $to = "example@gmail.com"; $subject = "Email from admin"; if ($_POST['submit']) { //get data from form $name = $_POST['name']; $message = $_POST['message']; if ($name&&$message) { $namelen = 20; $messagelen = 300; if (strlen($name)<=$namelen && strlen($message)<=$messagelen) { //everything is ok ini_set("SMTP", "smtp.gmail.com");
Where's your smtp authentication? You can't just set the mail server and that's it. http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html Use phpmailer (as this article suggests) and you'll have a lot better chance of things working. -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#46497) next »