XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .
Erm, install the application. Before you test your PHP (that sends an email) start the application. It will pop-up automatically with the email when it is sent. Added: If you have a default email-client (which you probably will have) the message will pop-up in, for example, Windows Live Mail or Outlook(Express).
BTW Spending too much time testing locally-sent emails is not particularly fruitful; you'll only have to do it all over again remotely . But the application I have referred is dead simple.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
Last edited by AndrewGSW; 01-11-2013 at 08:52 PM..
Erm, install the application. Before you test your PHP (that sends an email) start the application. It will pop-up automatically with the email when it is sent. Added: If you have a default email-client (which you probably will have) the message will pop-up in, for example, Windows Live Mail or Outlook(Express).
BTW Spending too much time testing locally-sent emails is not particularly fruitful; you'll only have to do it all over again remotely . But the application I have referred is dead simple.
Andrew,
whole concept of my PHP scrip is to fetch the data and send the mail to the DL list mentioned in the header.
now i am using XAMPP for development and need to test whether the right information is going.
Well with mail test server I have again failed my I dont know what mistake i am doing I have even try to check for any crash report but i dont find it anywhere.
Sorry, I'm not using XAMPP currently so I don't know where an error log might be located.
The problem might be in your script, so you could post some code and start a separate thread. However, your script may actually be working if you tried to send the email from your live site (rather than locally).
Assuming your page uses variables like $email, $message, etc., use
Code:
print_r($email); // etc.
just before sending the email. Then View the Source of the page to read these values to make sure they are correctly formed. var_dump() is another such function.
Add the following so that PHP will display all errors:
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
//execute the SQL query and return records $result = "SELECT * FROM $testcert WHERE Date = DATE_ADD(curdate(), INTERVAL 45 DAY)"; $check=mysql_query($result);
//fetch tha data from the database while ($row = mysql_fetch_array($check)) { $to = "XXXXXXXXXXXXXXXX@yahoo.com"; $subject = "Test mail"; echo $message = $row['description']; $from = "testmailtome@google.com"; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent."; } //close the connection mysql_close(); ?>
please help me if it the right way.................
Quote:
Originally Posted by AndrewGSW
Sorry, I'm not using XAMPP currently so I don't know where an error log might be located.
The problem might be in your script, so you could post some code and start a separate thread. However, your script may actually be working if you tried to send the email from your live site (rather than locally).
Assuming your page uses variables like $email, $message, etc., use
Code:
print_r($email); // etc.
just before sending the email. Then View the Source of the page to read these values to make sure they are correctly formed. var_dump() is another such function.
Add the following so that PHP will display all errors:
This would mean $testcert is an already defined variable which contains the name of a table? Otherwise, looks okay at a glance.
But the mysql library is deprecated and you should use mysqli or PDO in preference, and prepared statements.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
XAMPP comes with a mail server tool called, as I recall, TomCat(?). I wouldn't go near it in terms of trying to test emails locally - it's a nightmare to set-up .
To answer the OP's question. I haven't used Mercury in ages so I don't know much about it... but google might be able to give you some insite.. here is a direct link to the search
you don't need to run a local mail server, you're connected to the internet. your ISP provides you with an open access relaying SMTP server.
edit php.ini there's 4-5 lines in there were you can specify an outbound relay mail server.
If doing it this way you can just use the standard php mail() command with no changes and it'll work fine.
Alternatively you can use the swiftmail library for php and set the SwiftMailer::Transport to be SMTP and give it your ISP's outbound relay server (usually something like smtp.myisp.com or mail.myisp.com)
Both methods will work both are well described on google and both the PHP homepage and the SwiftMailer homepage.
If you're running on anything but a unix machine your local mail server attempt just wont work.
__________________
A programmer is just a tool which converts caffeine into code
you don't need to run a local mail server, you're connected to the internet. your ISP provides you with an open access relaying SMTP server.
edit php.ini there's 4-5 lines in there were you can specify an outbound relay mail server.
If doing it this way you can just use the standard php mail() command with no changes and it'll work fine.
I have already configured php.ini, not sure if you talking about the same 4-5 lines. Any post describe same....I have tried google but don't see any effective results.