sending email + php + with gmail

Page 1 of 1

7 Replies - 10895 Views - Last Post: 08 February 2013 - 05:13 AM Rate Topic: -----

#1 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

sending email + php + with gmail

Posted 10 August 2011 - 12:18 PM

hi all ,

I was trying to send email using gmail.
I configured both php.ini and sendmail.ini but i still get this error.

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\PhpProject1\index.php on line 14
Mail not sent!

please some one help me

here is the code for php.ini
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = menukadevinda@gmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"



please someone help me to correct this
thx in advance,
menuka

Is This A Good Question/Topic? 1
  • +

Replies To: sending email + php + with gmail

#2 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: sending email + php + with gmail

Posted 10 August 2011 - 12:49 PM

Aug 11 01:15:22 host=smtp.gmail.com tls=on auth=on user=[menukadevinda]@gmail.com from=[menukadevinda]@gmail.com recipients=menukadevinda@aol.com,â€,1.7.3 smtpstatus=535 smtpmsg='535-5.7.1 Username and Password not accepted. Learn more at \n535 5.7.1 [url]http://mail.google.com/support/bin/answer.py?answer=14257[/url] x1sm3952322fah.0' errormsg='authentication failed (method PLAIN)' exitcode=EX_NOPERM

i got above error from sendmail.log file
Was This Post Helpful? 0
  • +
  • -

#3 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: sending email + php + with gmail

Posted 10 August 2011 - 12:58 PM

here is the code for sendmail.ini


account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from [menukaDevinda]@gmail.com
auth on
user [menukaDevinda]@gmail.com
password [********]

port 587

# Set a default account
account default : Gmail








hi all,

i got the message emai sent here is php code
$subject="Hi There!!";
$to="<menukadevinda@aol.com>”;
$body=”This is my demo email sent using PHP on XAMPP Lite version 1.7.3";
if (mail($to,$subject,$body))
echo "Mail sent successfully!";
else
echo "Mail not sent!";





although, i got the message email "Mail sent successfully!" i did n't recieve a email to my aol account.

and i stil get the error that is in sendmail.log
Was This Post Helpful? 0
  • +
  • -

#4 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: sending email + php + with gmail

Posted 10 August 2011 - 08:06 PM

hi all ,

I am really happy after working over a night I solved the problem

here is the solution
config php.ini

SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 587

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = menukadevinda@gmail.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"




here is the code for sendmail.ini
account Gmail
tls on
tls_certcheck off
host smtp.gmail.com
from menukadevinda@gmail.com
auth on
user menukadevinda@gmail.com
password ********

port 587




and here is the php code
<?php
$to = "<menukadevinda@hotmail.com>;<menukadevinda@yahoo.com>";
$subject = "config";
$message = "I config php settings to send mail";
$from = "<menukadevinda@gmail.com>";
$headers = "From: $from";
if (mail($to,$subject,$message,$headers)){
echo "Mail sent successfully!";
}else{
 echo  "Mail not sent!";
    
}
?>



this works prety well.

cheeeeers.
Was This Post Helpful? 2
  • +
  • -

#5 menukadevinda  Icon User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 470
  • Joined: 14-April 11

Re: sending email + php + with gmail

Posted 12 August 2011 - 11:00 AM

hi , i host my site in 000webhost.
Does anybody have any idea how to config their php.ini and sendmail.ini
in order to send mails

thx.
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5182
  • View blog
  • Posts: 26,883
  • Joined: 10-May 07

Re: sending email + php + with gmail

Posted 12 August 2011 - 11:12 AM

You would need to call their customer support.

I can just short of guarantee you that you won't have access to those files.
Was This Post Helpful? 1
  • +
  • -

#7 murume  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 45
  • Joined: 21-June 11

Re: sending email + php + with gmail

Posted 08 February 2013 - 02:09 AM

View Postmenukadevinda, on 12 August 2011 - 11:00 AM, said:

hi , i host my site in 000webhost.
Does anybody have any idea how to config their php.ini and sendmail.ini
in order to send mails

thanks.

I'm having the same problem with a free account at 000webhost. Have you found a solution yet?
Was This Post Helpful? 0
  • +
  • -

#8 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6036
  • View blog
  • Posts: 23,431
  • Joined: 23-August 08

Re: sending email + php + with gmail

Posted 08 February 2013 - 05:13 AM

Did you even TRY to do what no2pencil suggested in the last post?

Closed.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1