PDA

View Full Version : SMTP problem


0810
09-15-2002, 10:09 PM
SMTP set up problem
hi how are you doing? I try to set up SMTP but I don't know how to set it up.




SMTP=(here) I don't know what I put in the ()


I know sendmail_from=itohideo@hotmail.com

I did mail code but I don't know hot to use SMTP with my script. Should I SMTP in my script or outside????? Could you tell me how to set it up.

Thanks you very much

My php is 4.22

Here is my code


<?
if(!isset($_POST[submit])){
?>
<form action="<?=$_SERVER["PHP_SELF"];?>" method="post">
<input type="text" name="name">
<input type="text" name="phone">
<input type="text" name="email">
<textarea rows="20" cols="20" name="bodytext"></textarea>
<input type="submit" value="Submit" name="submit">
</form>
<?
}else{
$myemail = "itohideo@hotmail.com";
$subject = "You have a message from $name";
$body = "$_POST[name] has sent you the following information.

His/her phone number is: $phone
His/her email is: $email
He/she has to say:
$_POST[bodytext]";
mail($myemail,$subject,$body,"From: $email");
}
?>

whackaxe
09-16-2002, 04:52 PM
that would be your smtp servers name for example for hotmail (dont do this unless yo uare allowed though!)
mail.hotmail.com
smtp.hotmail.com

that would configured in your PHP.ini file

to know which one it is just try conecting to each one on port 25 with telnet

0810
09-16-2002, 06:01 PM
I did like this. Can I do like this.

I am not sure if it is right or not.

Thank you very much



SMTP= smtp.hotmail.com
sendmail_from=itohideo@hotmail.com
<?
if(!isset($_POST[submit])){
?>
<form action="<?=$_SERVER["PHP_SELF"];?>" method="post">
<input type="text" name="name">
<input type="text" name="phone">
<input type="text" name="email">
<textarea rows="20" cols="20" name="bodytext"></textarea>
<input type="submit" value="Submit" name="submit">
</form>
<?
}else{
$myemail = "itohideo@hotmail.com";
$subject = "You have a message from $name";
$body = "$_POST[name] has sent you the following information.

His/her phone number is: $phone
His/her email is: $email
He/she has to say:
$_POST[bodytext]";
mail($myemail,$subject,$body,"From: $email");
}
?>

0810
09-17-2002, 02:12 AM
whackaxe hi how are you?
could you please help my script.
Is that ok???

whackaxe
09-17-2002, 04:53 PM
are you working off your server or on a free/paying host? if you are on a host then you will ahve to ask them about the mail() function. if not then go to the PHP.ini file which is the windows directory (if your using linux then dont ask me :p) and scroll down to the mail or smtp section and set the variables like i told you to before. i dont think there is a problem with your script

0810
09-17-2002, 06:13 PM
I am using postcastserver.com. It is free.
Do you know hot to set it up with postcastserver.

Thanks lot

bye for now

whackaxe
09-17-2002, 07:47 PM
my guess would be in the PHP.ini file instead of mail.hotmail.com put localhost (maybe localhost:25 where 25 would be the port number your server is set up on)

0810
09-17-2002, 08:46 PM
Hi how are you doing whackaxe?
Is that ok
This script is not working yet? DO you have any idea??

Thank you very much


SMTP=localhost:25

sendmail_from=itohideo@hotmail.com
<?
if(!isset($_POST[submit])){
?>
<form action="<?=$_SERVER["PHP_SELF"];?>" method="post">
<input type="text" name="name">
<input type="text" name="phone">
<input type="text" name="email">
<textarea rows="20" cols="20" name="bodytext"></textarea>
<input type="submit" value="Submit" name="submit">
</form>
<?
}else{
$myemail = "itohideo@hotmail.com";
$subject = "You have a message from $name";
$body = "$_POST[name] has sent you the following information.

His/her phone number is: $phone
His/her email is: $email
He/she has to say:
$_POST[bodytext]";
mail($myemail,$subject,$body,"From: $email");
}
?>

Jon T
02-01-2004, 07:28 PM
Contact your provider as well, they may be using another port number. I have seen serveral do this in the past to increase security through forms.