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. 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? 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 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 = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]'; mail($to, $subject, $message, $headers); ?> The receiver will see [email protected] in the From field on the email. 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 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. 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 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. 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
Archived
This topic is now archived and is closed to further replies.