Jump to content

How to send mail using googlemail SMTP server ?


Pesho

Recommended Posts

do you mean using gmails smtp address or you just want to have your gmail email address to appear as sender?

 

you just add extra headers:

 

<?php$to      = 'me@somewhere.com';
$subject = 'subject';
$message = 'messagesssss';
$headers = 'From: you_email@gmail.com' . "\r\n" .
    'Reply-To: you_email@gmail.com' . "\r\n";

mail($to, $subject, $message, $headers);
?> 

Link to comment
Share on other sites

i guess you're trying to make your own gmail app? otherwise you wouldn't need your password to be included in that. Can't really see the need to make your own gmail - but whatever floats your boat.

 

I would imagine it's possible sites like www.bebo.com let you sign in to gmail to access your contact book to add them as contacts to your social network.

Link to comment
Share on other sites

all right, I guess I don't want it so complicated, I just want to send an e-mail, but I don't know what SMTP to use.

 

ok, I changed the php.ini file with:

 

[mail function]
; For Win32 only.
SMTP = smtp.googlemail.com
smtp_port = 465

 

and added the following to my .php script:

 

$to      = 'myname@googlemail.com';
$subject = 'subject';
$message = 'messagesssss';
$headers = 'From: myname@googlemail.com' . "\r\n" .
    'Reply-To: myname@googlemail.com' . "\r\n";

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

 

However, it doesn't seem to work. It just gets stuck...

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.