Sending an e-mail from a non localhost mail server?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Fri Mar 30, 2007 2:58 am    Post subject: Sending an e-mail from a non localhost mail server? Reply with quote

My friend is working on a site using an e-mail host (i have told him about abyss but he dosent want to have to worry about running a server) He is using a host who gives him access to there SMTP mail server and he wants me to make him a contact script, which i can do, but i do not know how to make php send the mail out via a non local host.... I am using the mail(); function. Any help thanked :D
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Fri Mar 30, 2007 12:08 pm    Post subject: Reply with quote

I've stumbled across a PHP script that will send mail on behalf of a gmail account. If your friend has a Gmail account, the contact form can send mail to his gmail account, and he can pick it up via POP3 in Outlook Express.

Interested?
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
hc2995
-


Joined: 07 Aug 2006
Posts: 644
Location: Maryland, USA

PostPosted: Fri Mar 30, 2007 12:40 pm    Post subject: Reply with quote

pkSML wrote:
I've stumbled across a PHP script that will send mail on behalf of a gmail account. If your friend has a Gmail account, the contact form can send mail to his gmail account, and he can pick it up via POP3 in Outlook Express.

Interested?


I am
_________________
Where have i been? School got heck-tick, had to move half way around the state, then back... and then i had to change jobs, so iv been away for a while :P
Back to top View user's profile Send private message AIM Address
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Fri Aug 31, 2007 5:23 am    Post subject: Reply with quote

Done. Finally...

http://stephen.calvarybucyrus.org/redirect.php?page=gmail_php
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Fri Aug 31, 2007 6:43 am    Post subject: Reply with quote

pkSML wrote:
Done. Finally...

http://stephen.calvarybucyrus.org/redirect.php?page=gmail_php


That script contains a lot of erors that I've spotted. I will fix them and give you the fixed version to put on your site. Some of the problems, and the most annoying ones are E_NOTICE messages. Also, if you don't have Open SSL extension enabled, the script continues to run and outputs an error. I've done very stupid things like this too as a developer, and my new PHP and MySQL book teaches me not to.

I will work on the code right now and upload it to my server in a ZIP archive for you to download. You can debug by setting "error_reporting = E_ALL" in your php.ini file.

Edit: The script is fixed and E_NOTICES are no longer shown. I also added some extra code that prints an error message if it cannot find the OpenSSL PHP Extension (php_openssl.dll). Enjoy!

Download it here:
http://www.trustabyss.com/scripts/downloads/gmail.zip (Inlcudes the whole Kit and Caboodle)

Kind regards, Josh
Back to top View user's profile Send private message Visit poster's website
pkSML
-


Joined: 29 May 2006
Posts: 955
Location: Michigan, USA

PostPosted: Fri Aug 31, 2007 6:38 pm    Post subject: Reply with quote

I was coding about 4 hours past my bedtime! :)

Josh, thanks for taking the time to improve and fix the code. I updated my page and tested it.

Webmasters, note that the Open SSL extension in your php.ini file must be enabled.
Code:
extension=php_openssl.dll


http://stephen.calvarybucyrus.org/redirect.php?page=gmail_php
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group