Email with php

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


Joined: 23 Sep 2005
Posts: 18

PostPosted: Thu Oct 06, 2005 11:16 pm    Post subject: Email with php Reply with quote

i am trying to send email with php,
my php code is;
Quote:

<?php
$to = "paulgrogan@hotmail.com";
$from = "janedoe@anotherfakedomain.com";
$subject = "This is a test email";
$message = "Dear paul,\n\nThis is a fake email, I hope you enjoy it.\n\nFrom Jane.";

$headers = "From: $from\r\n";

$success = mail($to, $subject, $message, $headers);
if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from";
?>



now i dident expect that to work i know thers something to do with changeing the php.ini file ye?
well i used this tutoiral to set my php
http://www.aprelium.com/abyssws/php5win.html
so were is my php.ini file?
and what do i put in it?

ps if anyone knows of a free mail server pls say so
Back to top View user's profile Send private message
cmxflash
-


Joined: 11 Dec 2004
Posts: 872

PostPosted: Fri Oct 07, 2005 12:15 am    Post subject: Reply with quote

Try changing
Code:
 if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from";


to

Code:
 if ($success){
echo "The email to $to from $from was successfully sent";
}else{
echo "An error occurred when sending the email to $to from $from";
}
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Fri Oct 07, 2005 12:48 am    Post subject: Reply with quote

cmxflash wrote:
Try changing
Code:
 if ($success)
echo "The email to $to from $from was successfully sent";
else
echo "An error occurred when sending the email to $to from $from";


to

Code:
 if ($success){
echo "The email to $to from $from was successfully sent";
}else{
echo "An error occurred when sending the email to $to from $from";
}


Ain't nothing wrong with that, doesn't need correcting.

And php.ini is most likely in C:/windows or The directory of the php inturpretter under windows, don't know anbout other OSes.
Search for sendmail and similar topics because I can't be arsed to quote someone explaining about mail servers and php.
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Oct 07, 2005 2:09 pm    Post subject: Re: Email with php Reply with quote

mrpaul,

Your php.ini file is located in the PHP5 directory (see the notes at the bottom of http://www.aprelium.com/abyssws/php5win.html ).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
mrpaul
-


Joined: 23 Sep 2005
Posts: 18

PostPosted: Fri Oct 07, 2005 5:16 pm    Post subject: Reply with quote

So what do i put in it?
Back to top View user's profile Send private message
MonkeyNation
-


Joined: 05 Feb 2005
Posts: 921
Location: Cardiff

PostPosted: Fri Oct 07, 2005 6:07 pm    Post subject: Reply with quote

http://www.aprelium.com/forum/search.php?search_keywords=sendmail
_________________
Back to top View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger ICQ Number
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