Jump to content

PHP mail again ? PLZ HELP


halm1985

Recommended Posts

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

 

 

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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.