Re: Re: Need help-Send email

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx";
$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/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux