Jump to content

Help with email function!


nick_whitmarsh

Recommended Posts

Hi all,

 

I am trying to write a simple feebback form. It all appears to work apart from it does not send an email.

<?php
	$username = $_POST['username'];
	$useraddr = $_POST['useraddr'];
	$comments = $_POST['comments'];


	$to = "[email protected]";
	$re = "Website Feedback";
	$msg = $comments;
	mail( $to, $re, $msg );
?>

<html>
<head><title>Message Received</title></head>
<body>
<h3>Thanks for your comments</h3>
Message received from <?php echo ( $username ); ?>
<br />
Reply to <?php echo( $useraddr ); ?>
</body>
</html>

 

; For Win32 only.

SMTP = [email protected]

smtp_port = 25

 

; For Win32 only.

sendmail_from = [email protected]

 

I have also put my php.ini code, could anyone please help me.

 

Nick

Link to comment
https://forums.phpfreaks.com/topic/41232-help-with-email-function/
Share on other sites

I don't know much about how do you configure the mail() function, but let's try something else before- adding a from header:

 

<?php

if(!mail( $to, $re, $msg, "From: [email protected]" ))
  echo "PHP problem";
else
  echo "Problem with your spam filter probably...";

?>

 

Is it still giving you "PHP problem"?

 

Orio.

I dont think you can use hotmail anymore to do this not sure look it up on google.

 

your best bet is to setup the email as the email you was given from your isp ok hot mail see all mail as spam and blocks this ok.

 

 

example[mail function]

; Setup for Windows systems

SMTP = smtp.my.isp.net

sendmail_from = [email protected]

 

read this please

 

http://www.sitepoint.com/article/advanced-email-php

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.