Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi all,
I've written the following very simple piece of code.

<?php

echo'
<h1>Your emails</h1>
';

$to = 'demoPHP@localhost.com';

$subject = 'Email testing';

$message = 'test';

mail($to, $subject, $message);

?>

The email doesn't arrive in Thunderbird using Mercury Mail in XAMPP on Windows.

 

The text 'Your emails' appears in the browser so I know the file is being processed by PHP.

I can send an email using Thunderbird from 'demoPHP@localhost.com' to 'demoPHP@localhost.com' and it arrives in the inbox OK, so I know that Mercury is configured OK in that it's sending emails.

I've changed the php.ini file to the following:

 

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost.com

 

Does anyone have any ideas what I'm doing wrong. I'm actually running a Windows 64bit system. Would that make any difference? I'm referring to the fact that the php.ini file refers to 'Win32'.

 

Thanks

Paul

 

Link to comment
Share on other sites

No problem Larry.

 

However, if you don't use localhost to test your email coding what do you use?

 

My 'plan B' was to upload the code to a stand-alone page on my own live site and test it there. Obviously a bit more of a phaff because there's more chance of me winning a Nobel prize for PHP coding than my code working first time which means going backwards and forwards with FTPs.

 

Cheers

Paul

Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...