halm1985 Posted October 14, 2007 Share Posted October 14, 2007 Can somebody help me and tell me how sould my PHP settings be configured so that i become able to send E-mail messages from my site ( autmatic responses or scheduled messages ) .. It is different on localhost from the site on the web ??? knowing that it's not wroking on both with me .. Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 14, 2007 Share Posted October 14, 2007 Is your site not sending to all user or to just some user? Quote Link to comment Share on other sites More sharing options...
halm1985 Posted October 14, 2007 Author Share Posted October 14, 2007 It's not sending at all .. i'm using my e-mail address in the "to" part but i get nothing Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 14, 2007 Share Posted October 14, 2007 Please post the failing script. Ken Quote Link to comment Share on other sites More sharing options...
halm1985 Posted October 14, 2007 Author Share Posted October 14, 2007 The failing script is the ordinary mail() function script , any suggestions ?? Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 14, 2007 Share Posted October 14, 2007 If your hosting plan does not include smtp or smtp is not enabled, you will not be able to send email from your site. Quote Link to comment Share on other sites More sharing options...
nodisko Posted October 14, 2007 Share Posted October 14, 2007 Hmm. Is this true? my script is working from the shell but not when I load the script in a browser. SMTP is not set. I use sendmail. <?php mail("you@yourcorp.com", "PHP Test mail", "Hope this works! "); ?> Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 15, 2007 Share Posted October 15, 2007 Yeah, your good but I think -halm1985- is trying to use a FROM email address that is not associated with server at all. Could be the mail is being sent, but being sent to the recepients SPAM folder since the server email and FROM email do not match. Quote Link to comment Share on other sites More sharing options...
nodisko Posted October 15, 2007 Share Posted October 15, 2007 my script (above) is working from the shell but not when I load it in a browser. I have the feeling that I have to specificy priviliges or something. Any idea? Quote Link to comment Share on other sites More sharing options...
halm1985 Posted October 16, 2007 Author Share Posted October 16, 2007 Yeah, your good but I think -halm1985- is trying to use a FROM email address that is not associated with server at all. Could be the mail is being sent, but being sent to the recepients SPAM folder since the server email and FROM email do not match. No, i use a mail address under my domain, what problem could be there ? Also my host supports SMTP and provided me with the corresonding server ??? i thought the problem is much simpler !! Ther's an area in the php.ini file inlucdes : [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 Will any configuration here be handy ?? What about php mailer ?? did anyone use it ? Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 16, 2007 Share Posted October 16, 2007 That could be your problem on SMTP line. For example, mine uses: SMTP = something.server.net It will not accept = localhost I cannot use "localhost" when connecting to server through a script either. I have to define the URL of the server. You can get this from your hosting control panel mail settings for SMTP. If your server uses Sockets (SMTP) mail routine most commenly used is SMTP = mail.yoursite.com Quote Link to comment Share on other sites More sharing options...
halm1985 Posted October 16, 2007 Author Share Posted October 16, 2007 These are my settings using PHPMAILER .. I get the follwoing message on my browser : Message was not sent.Mailer error: SMTP Error: The following recipients failed: halm1985@hotmail.com <?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "halal-loan.com"; // SMTP server $mail->From = "info@halal-loan.com"; $mail->AddAddress("halm1985@hotmail.com"); $mail->Subject = "First PHPMailer Message"; $mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer."; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } ?> To add, when i change the name of the host i get another message Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known. in C:\wamp\www\mail\class.smtp.php on line 105 Warning: fsockopen() [function.fsockopen]: unable to connect to halal-lsoan.com:25 (Unknown error) in C:\wamp\www\mail\class.smtp.php on line 105 Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host. So, i think the host name is correct .. Plz help Quote Link to comment Share on other sites More sharing options...
monkeybidz Posted October 17, 2007 Share Posted October 17, 2007 Try this: <?php require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = "mail.halal-loan.com"; // SMTP server $mail->From = "info@halal-loan.com"; $mail->AddAddress("halm1985@hotmail.com"); $mail->Subject = "First PHPMailer Message"; $mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer."; $mail->WordWrap = 50; if(!$mail->Send()) { echo "Message was not sent."; echo "Mailer error:" .$mail->ErrorInfo; } else { echo "Message has been sent."; } ?> I added "mail." to HOST and changed single quotes to double in error messages. Also, make sure info@halal-loan.com is a real email address and notone from your catch all. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.