007Sites Support 007Sites Support
Official Support Forum
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

PHP Mail via Google's Gmail

 
Post new topic   Reply to topic    007Sites Support Forum Index -> FAQ
View previous topic :: View next topic  
Author Message
JT
Site Admin


Joined: 28 Jan 2008
Posts: 285

PostPosted: Fri Jan 23, 2009 9:25 pm    Post subject: PHP Mail via Google's Gmail Reply with quote

We now allow mail through PHP using the fsockopen function. We have allowed access only to the gmail smtp server as to keep abuse from occuring through fsocket and to preven people from spam mailing.

An example of this is this mod to phpbb

http://www.phpbb.com/community/viewtopic.php?f=16&t=345265&p=3048645#p3044743


Last edited by JT on Fri Jan 23, 2009 9:26 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JT
Site Admin


Joined: 28 Jan 2008
Posts: 285

PostPosted: Fri Jan 23, 2009 9:26 pm    Post subject: Reply with quote

Here is another example using the PHPMailer class

Code:
require("mailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.gmail.com"; // SMTP server
$mail->SMTPSecure = "tls";
$mail->From = "*****@gmail.com";
$mail->AddAddress("*****");
$mail->SMTPAuth=true;
$mail->Username='*******';
$mail->Password='*******';
$mail->Port=465;
$mail->Subject = "First PHPMailer Message";
$mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send())
{
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
echo 'Message has been sent.';
}
Back to top
View user's profile Send private message Send e-mail
Spiers
Guest





PostPosted: Mon Feb 16, 2009 5:52 pm    Post subject: Reply with quote

Can some one l=please help me to understand this a bit more. I would like to mail also and got the same error. Where do I put this code or is this a download?. I am not running phbb at this time Do you I need to?
Back to top
JT
Site Admin


Joined: 28 Jan 2008
Posts: 285

PostPosted: Wed Feb 18, 2009 2:30 pm    Post subject: Reply with quote

Are you writing a custom mailing page in php or using a pre-made script?
Back to top
View user's profile Send private message Send e-mail
Spiers
Guest





PostPosted: Wed Feb 18, 2009 11:53 pm    Post subject: Reply with quote

I would be using a pre made one. I have no clue how to program php into anything but an installation....lol. Al other sites would allow for email so this is new to me but understandable. Is all I do s download the php installer from google onto the site ? And then use the email account I created to send emails back and forth?

Also I am using LGSL for my game servers....since FS sockets not open an dI think they use them then I would not be able to use the program right

Also where do you paste that code at?
Back to top
JT
Site Admin


Joined: 28 Jan 2008
Posts: 285

PostPosted: Thu Feb 19, 2009 2:59 pm    Post subject: Reply with quote

I have no idea Confused I've never seen that software before. You may want to find the support forum and tell them that you need to use smtp to connect to gmail and see if they support it or has anyone done it before.
Back to top
View user's profile Send private message Send e-mail
Spiers
Guest





PostPosted: Sun Feb 22, 2009 6:27 pm    Post subject: Reply with quote

LGSL is a utility to monitor game servers and the amount of people in them...lol. but on that code for PhP mailer. Was doing some reading here and there at the PhP mailer site. I am confused on where to put that code? Does it go on all pages or just maybe index?
Back to top
JT
Site Admin


Joined: 28 Jan 2008
Posts: 285

PostPosted: Mon Feb 23, 2009 2:09 pm    Post subject: Reply with quote

Basically you make a directory called /phpmailer/ and place the php mailer code there.

Then on any page where you want to use that code snippet to send a mail you'll put a "require" command so it includes that code. (note...this is the first line in the code snippet on the first post)



Code:
require("mailer/class.phpmailer.php");
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    007Sites Support Forum Index -> FAQ All times are GMT
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



smartDark Style by Smartor
Powered by phpBB © 2001, 2002 phpBB Group
 
Check out a random forum: Sack Clan Online