Jump to content

does anyone know a php script to send mail using gmails/googles free smtp server


emopoops

Recommended Posts

i dont want to read the documentation on something i dont know how to use or if im going to use it.

 

You don't want to read the documentation because you don't know how to use it? That is ridiculous, where do you think the rest of us get our knowledge from?

 

how do i send from my site and email to another person?

 

Google apps smtp server is smtp.gmail.com on port 587, use your details and read this.

Link to comment
Share on other sites

If you are using XAMPP, you might have problems sending.

 

Your ISP may want to know who is sending through their servers.

It should be a lot easier if you upload your proposed script to

your ISP's server.

 

I had problems sending through XAMPP. As soon as I uploaded

my script, everything worked seamlessly. So....anyway,

 

If, for example, you had a form and wanted to send mail through it, you would first define the email address variable. e.g.

 

$email_address = addslashes(strip_tags($_POST['email_address']));

 

Then define the FROM: address to give the http headers information to the

server.

 

<?php

         

          //send activation email

 

          $to = $email_address . ', ' ;

          $subject = "Activate your account";

          $headers = "From: john.tobin1@gmail.com";

          $body = "Welcome $user_name,  Put the body of the email here";

 

 

?>

 

 

The vital step to actually send through gmail is to edit a file called php.ini

If you have a web site, you will just need to download that file from your ISP's root directory, and modify it,  telling it which SMTP server should be

used to send to send mail.

 

If your site is with Godaddy, then it would be Godaddy's

SMTP server. (NOT gmail's) For example in their case it would be

 

relay-hosting.secureserver.net

 

So in the php.ini file, just look for the corresponding SMTP

line in the script. If the file explicitly asks for a port number

it should be 25.

 

[mail function]

; For Win32 only.

SMTP = relay-hosting.secureserver.net

smtp_port = 25

 

 

Below is a sample Godaddy php.ini which they have stripped down

to a minimum of essential functions that they want.

'register_globals' should be = off

 

 

register_globals = off

allow_url_fopen = off

 

expose_php = Off

max_input_time = 60

variables_order = "EGPCS"

extension_dir = ./

upload_tmp_dir = /tmp

precision = 12

SMTP = relay-hosting.secureserver.net

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="

 

[Zend]

zend_extension=/usr/local/zo/ZendExtensionManager.so

zend_extension=/usr/local/zo/4_3/ZendOptimizer.so

 

 

This should do it for you.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.