Pesho Posted July 26, 2007 Share Posted July 26, 2007 Dear all, could someone tell me how I can send mail through a php script, using my googlemail account... thanks, Petar Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 26, 2007 Share Posted July 26, 2007 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); ?> Quote Link to comment Share on other sites More sharing options...
Pesho Posted July 26, 2007 Author Share Posted July 26, 2007 I mean the google SMTP address, with my account details (user and pass). Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 26, 2007 Share Posted July 26, 2007 i dont know if it will work try setting googles smpt address to your php.ini Quote Link to comment Share on other sites More sharing options...
black.horizons Posted July 26, 2007 Share Posted July 26, 2007 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. Quote Link to comment Share on other sites More sharing options...
Pesho Posted July 26, 2007 Author Share Posted July 26, 2007 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... Quote Link to comment Share on other sites More sharing options...
vbnullchar Posted July 26, 2007 Share Posted July 26, 2007 in your PHP.INI just put a valid SMTP address, you dont have to use gmails smtp address i you have one Quote Link to comment Share on other sites More sharing options...
Pesho Posted July 26, 2007 Author Share Posted July 26, 2007 I don't have my own SMTP address, but one I wrote up there (smtp.googlemail.com) is supposed to be valid. However it doesn't work. How can I see what's wrong... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.