Page 1 of 1

Mercury problems please help

PostPosted: 29. January 2012 10:56
by the_big_noob
XAMPP 1.73
Mercury/32
Windows XP SP3

When I run a test email script, I am getting the following error:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\_mail_test\test_mail.php on line 5
Message delivery failed...
----
I am trying to send it to my gmail mail account and test_mail.php is:
<?php
$to = "mygmailaccount@gmail.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

Re: Mercury problems please help

PostPosted: 29. January 2012 11:00
by Sharley
You may like to do an Advanced search of this XAMPP for Windows English forum for 'sendmail' as this issue is well covered with many successful solutions for version 1.7.3.

Mercury Mail is not used for the purpose you have outlined in your first post but sendmail is used for php scripts to send mail instead.

Re: Mercury problems please help

PostPosted: 29. January 2012 12:07
by the_big_noob
Ok so I found this video on youtube showing how to send mail between two localhost email accounts:

http://www.youtube.com/watch?v=_QnfF64rA78

same Mercury/32 that I am using too.

I am able to add 2 new mail accounts to localhost just fine like the video does under Configuration->Manage local users.

But when I use Thunderbird Portable to add these email accounts, it says ‘double-check this email address’ like it is NOT recognizing localhost.

It is definitely test_email1@localhost just like I added under Configuration->Manage local users, but localhost is not being recognized by Thunderbird. What should I check next? I am stuck… and it seems most people don’t have this problem who have followed the youtube video on mercury with xampp

I am definitely using localhost and NOT localhost.com

Re: Mercury problems please help

PostPosted: 29. January 2012 19:21
by WilliL
I've just tested it on localhost (xampp and thunderbird started on the same machine) it works fine.
On thunderbird create or edit an e-mail-account:
name, e-mail, password
then use manuel configuration :!:
Hint: username may be different to your e-mail-adress or your name
incoming -
servertype: pop3, server: localhost, port: 110,
security: none
authent.: password, unsecured

outgoing -
servertype: smtp, server: localhost, port: 25,
security: none
authent.: none

Its a free translation from German to English, but it should work.

Re: Mercury problems please help

PostPosted: 01. February 2012 20:01
by the_big_noob
I still can't seem to manage to connect to localhost. I am used to following tutorials and this is driving me insane! I appreciate the help so much WilliL.

I notice there is an Img tag I can use when I post a reply on this message board. I would like to post some screen shots of my XAMPP control panel, Port Check, Thunderbird Portable add email account screen, and my Mercury/32 mail screen where I define users so that you can say for sure that I am doing these correct.

However, how does this Img tag work?

Do I have to upload my images to a web server and then put the URL for the images between the Img tags? Or is there a way to get my images stored on my local machine posted to this board?

I really need to get this working because my OLD method of testing email within PHP scripts was to upload to my host's web server which is so time consuming I really can't do that anymore. Also, it's not practical when developing PHP scripts locally.

Thank you WilliL again. :lol:

Re: Mercury problems please help

PostPosted: 01. February 2012 20:35
by JonB
However, how does this Img tag work?

Do I have to upload my images to a web server and then put the URL for the images between the Img tags?


Yes -

Re: Mercury problems please help

PostPosted: 01. February 2012 20:39
by JonB
another option is to try out hMailserver (a much better Windows Mailserver) also free. (note: I have never used it for localhost, only 'live') They have well manged forums and the answer may be there or you can register and ask.

http://www.hmailserver.com/

Good Luck
8)

Re: Mercury problems please help

PostPosted: 01. February 2012 23:17
by Sharley
testing email within PHP scripts
As I pointed out way back in this topic all you need do is use sendmail which is designed specifically for your needs and is included in XAMPP.

Try these instructions that worked for another member who was wanting to use gmail in XAMPP 1.7.3 to send emails from a php script, which were found by using the advanced forum search that I also suggested previously and would have saved you much wasted time and needless frustration.
viewtopic.php?f=16&p=173315#p173315


Using a full blown email exchange server is like cracking a nut with a sledge hammer and would more than likely never work for your intended purpose.
These mail exchangers are meant to be used by large networks with their own domain names (not localhost) for sending and receiving emails for their network users.

BTW your ISP will most likely block any email exchange servers from localhost using port 25 because spammers use that method, so best asking them if they permit the use of Mercury Mail (or hMailServer) from your PC using localhost (doubtful), which is just another obstacle to overcome if you persist in using a sledgehammer to crack this very small nut. ;)

Good luck and please do post back with any issues you may find by using sendmail. :)