Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2169 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP Form to email help please

Thread title: PHP Form to email help please
Closed Thread    
    Thread tools Search this thread Display Modes  
07-14-2005, 11:28 AM
#1
soundsalarming is offline soundsalarming
soundsalarming's Avatar
Status: I'm new around here
Join date: May 2005
Location: Worcester UK
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

soundsalarming is on a distinguished road

  Old  PHP Form to email help please

Long story short:

Ive built a site for a mate who uses Portland hosting. Portland are having problems with sendmail on their servers which they seem unable to resolve, so they have told me that I need to use SMTP mail and sent me this script.

Code:
<?
include("Mail.php");

$recipients = "mail_to@domain.mail";

$headers["From"]    = "mail_from@domain.mail";
$headers["To"]      = "mail_to@domain.mail";
$headers["Subject"] = "Test message";

$body = "TEST MESSAGE!!!";

$params["host"] = "10.14.0.16";
$params["port"] = "25";
$params["auth"] = false;
$params["username"] = "user";
$params["password"] = "password";

// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);

$mail_object->send($recipients, $headers, $body);
?>
The script calls for mail.php which I dont have.

Is this a common php page that is located on the server or something I need to create?

07-14-2005, 03:41 PM
#2
Koobi is offline Koobi
Koobi's Avatar
Status: Member
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 312
iTrader: 0 / 0%
 

Koobi is on a distinguished road

  Old

it's something specific, not a common script.

you should ask them to send you Mail.php as well.

07-14-2005, 04:25 PM
#3
bizzar is offline bizzar
Status: I'm new around here
Join date: May 2005
Location:
Expertise:
Software:
 
Posts: 12
iTrader: 0 / 0%
 

bizzar is on a distinguished road

  Old

that looks like the format from the common smtp class that you can find... just google for "php smtp class" and it should give you some results.

Here's a couple of quick links I found:

http://www.phpclasses.org/browse/package/1044.html

http://php.resourceindex.com/detail/00895.html

http://phpmailer.sourceforge.net/

Basically, read the documentation. The company sounds like they want you to route all your mail though a smtp gateway instead of using sendmail directly. PHP can do that, but you'll have to use a class.

07-15-2005, 03:18 AM
#4
painperdu is offline painperdu
Status: Junior Member
Join date: May 2005
Location: Louisiana, USA
Expertise:
Software:
 
Posts: 37
iTrader: 0 / 0%
 

painperdu is on a distinguished road

  Old

It looks like the PHP PEAR Mail object. Have you tried running the script?

If your provider has it set up correctly then it should work as is.

07-15-2005, 07:04 AM
#5
Koobi is offline Koobi
Koobi's Avatar
Status: Member
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 312
iTrader: 0 / 0%
 

Koobi is on a distinguished road

  Old

heh heh personally i would make sure that the file is exactly what i think it is because if it isn't the same file though it might contain the same function/method name, it can pose problems...unless you look at the code for that class yourself

in my opinion, the best thing to do is ask the person who gave you that script what Mail.php is

07-15-2005, 01:18 PM
#6
soundsalarming is offline soundsalarming
soundsalarming's Avatar
Status: I'm new around here
Join date: May 2005
Location: Worcester UK
Expertise:
Software:
 
Posts: 11
iTrader: 0 / 0%
 

soundsalarming is on a distinguished road

  Old

Originally Posted by painperdu
It looks like the PHP PEAR Mail object. Have you tried running the script?

If your provider has it set up correctly then it should work as is.
Thanks painperdu, you're spot on. The server has been set up with PEAR so the script works as it is.

The only problem is that it takes over an hour for the email to get to me but I'm not bothered about that he can take it up with the hosting company. At least I can get paid for the site design now.

Thanks again buddy.

07-15-2005, 01:28 PM
#7
seen.to is offline seen.to
seen.to's Avatar
Status: unusual suspect ™
Join date: Feb 2005
Location: Lancaster, PA from London UK
Expertise:
Software:
 
Posts: 1,814
iTrader: 0 / 0%
 

seen.to is on a distinguished road

  Old

Pretty lame of them to not have sendmail working.

If your client has problems with the time taken with SMTP and doesn't want to pay you take a look at the free services at www.cutandpastescripts.com

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed