Jump to content

Problem with MAIL


BadGoat

Recommended Posts

Heya!

 

I am having a problem with a simple mail script... It doesn't send! I have PHP5 installed on our company webserver. Our website is ASP-based, and there are a few ASP scripts which send emails successfully. This server hosted some older PHP scripts which used to mail stuff out also, and I tried to test the mail using the old scripts and they fail as well. So while I admit to being a nooblet, I would think that the server is set up to email correctly... ? So far, none of the PHP scripts have worked out, including the FreakMailer mail tutorial, which I tried this morning. I am not sure what I need to check next. My simple little email script is below. This page

 

<?php

$connect = mssql_connect("***","***", "***")

  or die("Could not connect");

$result = mssql_select_db("***")

  or die("Could not select that database !");

 

error_reporting(0);

 

// To send HTML mail, the Content-type header must be set

$from = "From: Form Results <test@domain.com>";

$to = "badgoat@domain.com";

$subject = "TEST";

$body =

($_POST['name'] . "\r" .

$_POST['phone']  . "\r" .

$_POST['email'] . "\r" .

$_POST['comments'] . "\r\n");

 

$email=$_POST['email'];

if(mail($from,$to,$subject,$body)) echo "Data Recieved Successfully";

else echo "MAIL FAILED";

?>

 

Might it be a problem with the PHP.ini file? Would I be better off trying to get the admin to allow me to install Apache? Any suggestions would be most appreciated, I am sincerely stuck.

Link to comment
Share on other sites

Here are all the variables associated with mail:

 

mail.force_extra_parameters no value no value

sendmail_from scheduling@domain.com scheduling@domain.com

sendmail_path no value no value

Internal Sendmail Support for Windows enabled

 

SMTP localhost localhost

smtp_port 25 25

 

 

I would guess that mail is enabled... Is that correct?

Link to comment
Share on other sites

im not sure :-\, dont forget to put {s after you open a function (edited lol, wtf is a finction ???)

 

<?php

$connect = mssql_connect("***","***", "***")

or die("Could not connect");

$result = mssql_select_db("***")

or die("Could not select that database !");

 

error_reporting(0);

 

// To send HTML mail, the Content-type header must be set

$from = "From: Form Results <test@domain.com>";

$to = "badgoat@domain.com";

$subject = "TEST";

$body =

($_POST['name'] . "\r" .

$_POST['phone'] . "\r" .

$_POST['email'] . "\r" .

$_POST['comments'] . "\r\n");

 

$email=$_POST['email'];

if(mail($from,$to,$subject,$body)){ echo "Data Recieved Successfully";

}else{ echo "MAIL FAILED"; }

?>

 

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.