madspof Posted September 8, 2007 Share Posted September 8, 2007 Hi I am trying to send email via a gmail acount and I am not able to. I have run various scripts but they all amount to an error. Does anyone have a email script that uses authization and works with gmail. Thanks madspof. Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/ Share on other sites More sharing options...
BlueSkyIS Posted September 8, 2007 Share Posted September 8, 2007 i expect this is a tall order. do you HAVE to send the email through gmail? Can you simply change the From, Return-to and other headers to use a gmail return address? Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344418 Share on other sites More sharing options...
madspof Posted September 8, 2007 Author Share Posted September 8, 2007 Hm explain what you mean im confused Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344419 Share on other sites More sharing options...
BlueSkyIS Posted September 8, 2007 Share Posted September 8, 2007 in other words, just use the php mail() function: http://us2.php.net/function.mail and use additional headers to define the from, return-to and other fields: $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@gmail.com' . "\r\n" . 'Reply-To: webmaster@gmail.com'; mail($to, $subject, $message, $headers); ?> The receiver will see webmaster@gmail.com in the From field on the email. Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344424 Share on other sites More sharing options...
madspof Posted September 8, 2007 Author Share Posted September 8, 2007 Ah I see what you mean but i am hosting my own server and i need a way of accessing the the gmail smtp server using autherisation Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344426 Share on other sites More sharing options...
BlueSkyIS Posted September 8, 2007 Share Posted September 8, 2007 Oh, I see. So you want to get mail and send mail to/from your gmail account. Not just make it look like mail is coming from gmail. My bad. Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344429 Share on other sites More sharing options...
madspof Posted September 8, 2007 Author Share Posted September 8, 2007 Yes exactual but i have hit a brickwall and cannot go any further Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344430 Share on other sites More sharing options...
BlueSkyIS Posted September 8, 2007 Share Posted September 8, 2007 have you looked for any pre-built classes to help, for instance: http://www.phpclasses.org/browse/package/14.html will apparently retrieve via SMTP. You may need something else to send... phpclasses.org is an excellent resource for pre-written PHP classes. Quote Link to comment https://forums.phpfreaks.com/topic/68522-sending-email-via-gmail-i-really-cannot-get-this-to-work/#findComment-344434 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.