0

I'm trying to send mails from my server by google app.

I am using this php code :-

$to = "username@gmail.com";
$header = "From: username@netvigator.com";
$subject = "testing mail";
$message = "no reply pls";

ini_set("SMTP","smtp.gmail.com");
ini_set("SMTP_PORT", 23);
ini_set("sendmail_from","username@fullpiracy.com");
ini_set("auth_username","username@fullpiracy.com");
ini_set("auth_password","password");

mail($to, $subject, $message, $header);

Thanks in advance !

Damien Pirsy
  • 25,319
  • 8
  • 70
  • 77

2 Answers2

1

This was done with send mail open source library.

http://www.sendmail.com/sm/open_source/

0

I believe Gmail uses SSL (or TLS), so you should adjust your settings accordingly.

The port is usually 465 for ssl connection and 587 for TLS, and address are ssl://smtp.gmail.com and tls://smtp.gmail.com respectively.

Here is a link to a useful SO question that may be helpful.

Community
  • 1
  • 1
Damien Pirsy
  • 25,319
  • 8
  • 70
  • 77