1

Possible Duplicate:
Send email using GMail SMTP server from PHP page

I have been trying to send a mail to my own gmail address using php's mail function. I wanted to know how it really works. I enabled the required pop and imap settings in my gmail account. It failed. Googling it gave me some solutions as to add some lines like ini_set("SMTP","smtp.gmail.com"); ini_set("smtp_port","587"); to my code. But this too didn't really work out. I get the error message as :- SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. xu6sm18854524igb.7 any ideas where am i going wrong ?

Community
  • 1
  • 1
qre0ct
  • 5,680
  • 10
  • 50
  • 86
  • 1
    This is because GMail requires you to use an SSL connection. See [this question](http://stackoverflow.com/questions/712392/send-email-using-gmail-smtp-server-from-php-page). – user703016 Dec 30 '11 at 10:06
  • "To" your own gmail account or "with" your own gmail account. You don't need to modify Gmail setting to send an e-mail "to" your account. You only have to modify them if you want to send and get e-mails from another server using your gmail account. So, if you just want to send an e-mail "to" your gmail account, that `ini_set` are not needed and maybe you should look at your mail server configuration. – Waiting for Dev... Dec 30 '11 at 10:10
  • "to" and also "with" my own gmail account, though both of them are 2 different accounts, both belonging to me. As i told, i want to see how it really works. My mail server is perhaps properly configured. – qre0ct Dec 30 '11 at 10:23
  • @Cicada ..i understand that gmail requires an SSL connection to be used. Can you please let me know how do i do this? – qre0ct Dec 30 '11 at 10:29

0 Answers0