Problem with sending mails in xampp

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Problem with sending mails in xampp

Postby karthika25 » 09. November 2006 20:29

Hi,

I face a problem when i am trying to create a code which sends mails. The error is,

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files\xampp\htdocs\mail.php on line 7


I tried changing the sendmail_from lines in the php.ini, but in vain. I was not able to succeed.

The code i used is,

<?php
$msg="Thank You For Signing Up! Your activation code is ";
$sub="Your Activation Code";
$to="test@gmail.com";
$from="noreply@test.com";
$ret=mail($to,$sub,$msg,$from);
?>


Please let me know the changes to be made and the path of the file. Because php.ini is available in multiple locations in the xampp folder. Thanks!
KaRtHiK
karthika25
 
Posts: 1
Joined: 09. November 2006 20:05

Postby Izzy » 10. November 2006 01:31

The php.ini file Apache uses in XAMPP is located here:
xampp\apache\bin\php.ini
Make your edits in this php.ini file only.

Also you can try this:
Find this section in the above php.ini file and set it to your ISPs smtp setting:

[mail function]
; For Win32 only.
SMTP = smtp.yourisp.tld
smtp_port = 25

; For Win32 only.
sendmail_from = you@yourisp.tld


Save and restart Apache.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby lyntuan » 10. November 2006 01:53

You can not use PHP mail function with smtp auth. mail server as gmail or yahoo.
In another cases, you can use ini_set and ini_restore to set and unset smtp, smtp_port, sendmail_from.
Last edited by lyntuan on 26. December 2008 13:01, edited 1 time in total.
lyntuan
 
Posts: 104
Joined: 08. November 2006 00:21

Postby WorldDrknss » 10. November 2006 06:23

Step by Step on how to use PHP mail function with smtp auth. As you may notice that no one here has any idea what sendmail is.

Open up MercuryMail and click on configuration and then go to Protocal Modules here we will only check the protocals that we need. The following should only be check:
-MercuryS SMTP Server
-MercuryP POP3 Server
-MercuryC SMTP relaying client
-MercuryD distributing POP3 client
-MecuryI IMAP4rev1 Server
Restart MercuryMail
Once back in mercurymail click on configuration and then go to MercuryC SMTP client and fill in the following information.
Smart host name: smtp.somedomain.com <-your isp smtp server should go here.
then click on save once you have those fields completed.
Click on configuration and go to Mercury core module and click on the Local domains tab, then click on add new domain, then add your domain to both the boxes and click ok. Next we will add which users will have an email account on your server and to do this click on configuration then go to Manage local users here you can edit, delete, or add users.

open xampp\apache\bin\php.ini

*Repleace yourxampppath with the path to your XAMPP folder
Ex: C:/Program Files/xampp

Change this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "yourxampppath/sendmail/sendmail.exe -t"

to this:

[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "yourxampppath/sendmail/sendmail.exe -t"

then go to your sendmail folder and open sendmail.ini and make it look similar this:

; configuration for fake sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server

smtp_server=localhost

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=local

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

;error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

;debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=yourusername you supplied in MercuryMail
auth_password=yourpassword you supplied in MercuryMail
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines

;pop3_server=
;pop3_username=
;pop3_password=

; to force the sender to always be the following email address, uncomment and
; populate with a valid email address. this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content

;force_sender=me@localhost

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required

;hostname=localhost



Good Luck
http://wdguides.org - XAMPP Tutorials & MORE!!!!
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

Postby Izzy » 10. November 2006 10:55

Members and guest visitors to these forums should exercise extreme caution when using unofficial third party XAMPP help sites. You should use the XAMPP help files and facilities available from the official ApacheFriends web site and from within the various configuration files in the form of item comments.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby WorldDrknss » 10. November 2006 13:52

WOW that is so ironic IZZY, because you linked to unofficial help sites in this thread: http://community.apachefriends.org/f/viewtopic.php?t=21045 such as http://www.lifehacker.com/software/emai ... 111166.php then after I posted you edited all your post to:
Members should be very cautious about using unofficial third party help sites and should use the XAMPP help files and facilities available from the official ApacheFriends web site.

This thread has been hijacked for obviously devious reasons.
but the fact is if you give members correct information then I would not have to correct you.

By mentioning that you are saying do not trust any third party sites, essentially your saying DO NOT trust http://www.phpfreaks.com/, http://www.devshed.com/c/b/PHP/, http://www.phpbuilder.com/ for php help because it is not the OFFICIAL php site, and don't trust http://www.apachelounge.com/ or any other apache help site because it is not the OFFICIAL apache website. This will also include Apachefriends because Apachefriends is a third party help site for Apache, MySQL, PHP, FileZilla, and MercuryMail which makes up the various components of XAMPP an Apache Distribution. If you want help with XAMPP then you should be posting at apache.org, php.net, filezilla.sourceforge.net, pmail.com/overviews/ovw_mercury.htm, and so on.

Seriously your posts like this are childish and getting very old, for a person your age I would have suspected more from you.

So in others words you should be saying: DO NOT trust http://xampptutorials.com because I have a grudge against WorldDrknss. I am jealous that he was able to provide a website consisting of Tutorials and Generators to make the installation of XAMPP go smoothly for everyone and for his superior knowledge of XAMPP, Apache, MySQL and PHP. :lol:

Yes you have more posts than me, but that is because I have several sites to manage, I works and I am a full time student. I do not have time to sit on my crack all day and wait for a new thread to appear to answer it.
Enjoy

99.9% of people use unofficially/third party sites each and everyday, but yet only one person on this forum will only make a note of that after I have posted. I do not see IZZY posting on other people posts saying do not trust third party sites. So to me this seems that jealousy is in play here.

At least for the people who use my site, I insure them the highest security possible, and I provide them useful and correct answers.

Best of luck to all fellow XAMPPERS
Thanks XAMPP-Dev Team keep up the good work.
This will be my last post at Apachefriends
I am NO longer supporting XAMPP
http://wdguides.org - XAMPP Tutorials & MORE!!!!
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

Postby Sidetrack » 11. November 2006 04:54

Izzy wrote:Members and guest visitors to these forums should exercise extreme caution when using unofficial third party XAMPP help sites. You should use the XAMPP help files and facilities available from the official ApacheFriends web site and from within the various configuration files in the form of item comments.


Dude, that is freaking uncool.. bash another member for trying to help. if this happens on my forums, this would not be tolerated. This is NOT how support should be done.. if you got a problem with another member, take it up with that member.. Xampp is damn hard enuf to setup. I personally found xampptutorials to be helpful and I in the past found this site helpful. not becuase of the data, but the EXTERNAL as you call it 3rd party support links, that actually made sense.. this type of attitude is embarrassing for XAMPP support and apachefriends.. disappointment is all I have..

Izzy wrote:Izzy
Please help save our whales - http://www.whalesrevenge.com
1. Tell your friends and family
2. Email it to everyone you know
3. Post it on websites, blogs and forums

is this a 3rd party site, is it an "official" site.. come on.. whats the difference? its not cool dude.. others trying to help.. thats what OPEN SOURCE IS ABOUT DUDE..
Its not the insane ppl in a mental hospital, its the sane ppl trying to deal with an insane world.
Sidetrack
 
Posts: 2
Joined: 12. February 2006 19:42
Location: in a crackerjack box, in the middle of NOwhere,USA

Postby dantheman » 05. December 2006 13:40

Hi WorldDrknss,
I am currently trying to create an email validation system for my website (from a tutorial at http://biorust.com/index.php?page=tutor ... &tutid=115) using xampp with Mercury as the mail server and the website has been created in Dreamweaver. The only problem thus far is that when filling in the registration form, no email is sent. So after searching google for a solution, I found this page.
I have followed your instructions, but I am not entirely sure about a couple of things for which I would be very grateful if you could clarify them for me.

For "Smart host name: smtp.somedomain.com <-your isp smtp server should go here." do I just put "localhost" or smtp.localhost?

and

As I am not using any domain name (e.g. www.joeblogs.com) at the moment, rather just using the http://localhost url to view my pages until all is completed, do I not need to bother inserting a domain name under the Local domains tab, due to there being a localhost name on the list already?

Likewise, I believe that my smtp server is just referred to as localhost.

Cheers,
Dan
dantheman
 
Posts: 1
Joined: 05. December 2006 13:10
Location: Europe

Postby WorldDrknss » 19. December 2006 00:16

yes your SMTP server will just be localhost, and you will only be able to send emails to yourself (Accounts you created in MercuryMail) as most major Email Services/ISPs will block emails from dynamic IPs.
http://wdguides.org - XAMPP Tutorials & MORE!!!!
User avatar
WorldDrknss
 
Posts: 292
Joined: 17. September 2005 13:40

Postby nath042 » 30. December 2006 16:53

hi i had this problem but solved most of it by opening ports 25 on my router but it still wont let me send mail past localhost, it keeps saying this:
30 Dec 06 15:42, Servicing job MO000015... 550 you are not allowed to send mail to <nath042@hotmail.co.uk>


can anyone help? is it because i have a dynamic ip (well i think i do but it hasnt changed)

Thanks alot,
Nath042 :D
nath042
 
Posts: 1
Joined: 30. December 2006 13:54

tutorial and 2 questions

Postby vyoufinder » 31. December 2006 07:11

WorldDrknss wrote:Step by Step on how to use PHP mail function with smtp auth. As you may notice that no one here has any idea what sendmail is.

Open up MercuryMail and click on configuration and then go to Protocal Modules here we will only check the protocals that we need. The following should only be check:
-MercuryS SMTP Server
-MercuryP POP3 Server
-MercuryC SMTP relaying client
-MercuryD distributing POP3 client
-MecuryI IMAP4rev1 Server
Restart MercuryMail
Once back in mercurymail click on configuration and then go to MercuryC SMTP client and fill in the following information.
Smart host name: smtp.somedomain.com <-your isp smtp server should go here.
then click on save once you have those fields completed.
Click on configuration and go to Mercury core module and click on the Local domains tab, then click on add new domain, then add your domain to both the boxes and click ok. Next we will add which users will have an email account on your server and to do this click on configuration then go to Manage local users here you can edit, delete, or add users.

open xampp\apache\bin\php.ini

*Repleace yourxampppath with the path to your XAMPP folder
Ex: C:/Program Files/xampp

Change this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "yourxampppath/sendmail/sendmail.exe -t"

to this:

[mail function]
; For Win32 only.
;SMTP = localhost
;smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "yourxampppath/sendmail/sendmail.exe -t"

then go to your sendmail folder and open sendmail.ini and make it look similar this:

; configuration for fake sendmail

[sendmail]

; you must change mail.mydomain.com to your smtp server

smtp_server=localhost

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=local

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

;error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

;debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=yourusername you supplied in MercuryMail
auth_password=yourpassword you supplied in MercuryMail
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines

;pop3_server=
;pop3_username=
;pop3_password=

; to force the sender to always be the following email address, uncomment and
; populate with a valid email address. this will only affect the "MAIL FROM"
; command, it won't modify the "From: " header of the message content

;force_sender=me@localhost

; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required

;hostname=localhost



Good Luck


Here's another tutorial in VIDEO format for anyone trying to setup MercuryMail for windows on their xampp server:

http://www.xampptutorials.com/tutorials ... ercuryMail

I also have 2 questions:

1. where you say I need ot enter in my isp's smtp server.. Could I use a gmail smtp server instead or does it necessarily need to be my isp smtp server. The reason I ask is that I don't have an isp at all, I'm using a wireless network in my neighborhood and I'm not the account owner, nor do I know the smtp server information.

2. Is Mercury Mail using sendmail, fake sendmail for windows, or is it it's own thing and completely different. I've only used sendmail on Linux servers and only via scripts so just trying to figure out what exactly Mercury Mail is!
vyoufinder
 
Posts: 6
Joined: 29. September 2006 15:46


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 34 guests