View Full Version : emailing from a localhost
city_coder
05-27-2008, 04:30 PM
Hi guys,
iv had a lot of posts over the last few days anyway i was sort of hoping you could help me with this one as well.
I want to be able to send a confirmation email to an email address(obviously) from my pc that i have set up using XAMPP. Every time i try to, it says
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\ehomeboot\signup.php on line 238
Which isnt very kind on my eyes never mind on users eyes. How do i go about sending the email from the localhost setup? obviously i know i have to have a connection to the internet. but what settings do i need to edit?
any help would be great!
Medyman
05-27-2008, 04:55 PM
XAMPP isn't a mail server. You'll need to install one. XAMPP for Windows comes with Mercury Mail (http://en.wikipedia.org/wiki/Mercury_Mail_Transport_System) which should allow you to send emails just fine (after some configuration).
city_coder
05-27-2008, 06:04 PM
Ok cheers, i know you've told me what to do, im just crap at getting things to work. I just need to know what happens next. Iv got XAMPP on windows already so great, but how do i go about configuring mercury mail??
cheers, sorry to sound thick, but well i am when it comes to this lol :D
Medyman
05-27-2008, 06:10 PM
I don't use XAMPP, so I have no idea. But maybe some of the links on the wiki page I linked you to will help?
Otherwise, wait for someone who uses XAMPP :D
Ok cheers, i know you've told me what to do, im just crap at getting things to work. I just need to know what happens next. Iv got XAMPP on windows already so great, but how do i go about configuring mercury mail??
cheers, sorry to sound thick, but well i am when it comes to this lol :D
I don't know about XAMPP either, but mercury is a nobrainer. Just a few clicks, setup an alias for your local account and you're good to go.
city_coder
05-27-2008, 09:06 PM
Yeah apparently it is a no brainer but i dont understand. maybe somebody that says its so easy can actually give me a few steps cos all uv all said is that its easy.
im at a complete loss as to what it even is never mind getting it to send emails.
Oops,
Sorry about that. I didn't explain, because I don't know how xammp is setup. I only know the mercury part. When you go to configuration / mercury core module you setup your server configuration. Under manage users you setup your local users and your alias. You might limit only local users to mail.
I don't know your setup so I'm sorry I can't be more of assistance
city_coder
05-28-2008, 10:38 PM
Ok cheers, well that was about as useful as c*ck flavoured lollipop to me lol no offence. its just me. i really dont get thats all. but thanks anyway
Ok cheers, well that was about as useful as c*ck flavoured lollipop to me lol no offence. its just me. i really dont get thats all. but thanks anyway
Than who don't you make it easier and tell me what you have so far?
city_coder
05-29-2008, 01:05 PM
Ok well il try. I just dont get where it fits in.
I have a local server setup on my pc, apache and i want to be able to send emails out using a PHP script. Now i know that i need a mail server but does that mean that i need an alias? whatever that is?! i dont know.
so my questions is i guess...
what exactly is mercury mail and how do i use that to send emails(is it like forwarding? or do u not associate an email address with it?)
Medyman
05-29-2008, 03:42 PM
Hey City_coder...
I still don't have much to add on this topic but I wanted to point you towards the Mercury Mail forums (http://community.pmail.com/forums/default.aspx). Perhaps you can find some information there?
Just an idea. Hope that helps some.
Ok well il try. I just dont get where it fits in.
I have a local server setup on my pc, apache and i want to be able to send emails out using a PHP script. Now i know that i need a mail server but does that mean that i need an alias? whatever that is?! i dont know.
so my questions is i guess...
what exactly is mercury mail and how do i use that to send emails(is it like forwarding? or do u not associate an email address with it?)
I'm still guessing here, because you provide little information;
Do you have a domainname?
Why do you need to send mail through php?
What server configuration does mercury has?
I downloaded the zip of xampp, but I see there is an installer too. What version of xampp are you using?
Just a few question I can think of.
what exactly is mercury mail
I assume you're joking!
how do i use that to send emails(is it like forwarding? or do u not associate an email address with it?
Do you have a domainname? Do you want it to forward?
city_coder
05-29-2008, 10:06 PM
Ok, sorry il try again,
nope no domain name sorry
im sending mail through a script because im writing a mailing script for signing up to a site. This site is in building & testing at the minute and so there is no point me buying a domain name and web space.
as to what server configuration mercury has well i dont know and i can tell u that because of the answer you assumed, i still dont know what mercury is besides a mail server, especially dont know how it works.
erm the latest version of xampp, i dont think it will make much difference to mercury as it will be the same...im guessing, i could be wrong.
sorry, hope that helps in some way
erm the latest version of xampp, i dont think it will make much difference to mercury as it will be the same...im guessing, i could be wrong.
No, you're right. It's just for pointing directory locations. If you haven't configured your server yet, there is no harm in posting your mercury.ini here.
im sending mail through a script because im writing a mailing script for signing up to a site. This site is in building & testing at the minute and so there is no point me buying a domain name and web space.
Why do you need your script to mail? Why not insert it into a table?
city_coder
05-30-2008, 07:25 AM
Right ok, heres my mercury.ini file it should be the same as yours(if you did install it)
# MERCURY.INI generated by Mercury Setup
[General]
myname: localhost # Canonical name for this server
timezone: +0000 # Time Zone to add to date fields
file_api: 1 # Use the file api instead of queues
mailqueue: C:\xampp\MERCURYMAIL\QUEUE # Where mail should be put for delivery
smtpqueue: C:\xampp\MERCURYMAIL\QUEUE # Where the SMTP client should look for mail
newmail_path: C:\xampp\MERCURYMAIL\MAIL\~N # Where to find the users' WinPMail mailboxes.
[Protocols]
C:\xampp\MERCURYMAIL\mercurys.dll
C:\xampp\MERCURYMAIL\mercurye.dll
C:\xampp\MERCURYMAIL\mercuryp.dll
C:\xampp\MERCURYMAIL\mercuryd.dll
C:\xampp\MERCURYMAIL\mercuryx.dll
C:\xampp\MERCURYMAIL\mercuryf.dll
C:\xampp\MERCURYMAIL\mercuryh.dll
C:\xampp\MERCURYMAIL\mercuryw.dll
C:\xampp\MERCURYMAIL\mercuryi.dll
C:\xampp\MERCURYMAIL\mercuryb.dll
[Mercury]
failfile: C:\xampp\MERCURYMAIL\Mercury\FAILURE.MER # Delivery failure notification template
confirmfile: C:\xampp\MERCURYMAIL\Mercury\CONFIRM.MER # Delivery confirmation template
aliasfile: C:\xampp\MERCURYMAIL\Mercury\ALIAS.MER # System-wide alias file
synfile: C:\xampp\MERCURYMAIL\Mercury\SYNONYM.MER # User synonym database
listfile: C:\xampp\MERCURYMAIL\Mercury\LISTS.MER # List of lists
logwidth: 30 # Width of address fields in logfile
retpath: 1 # Do/Don't use 'return-path' for errors
maxhops: 30 # Used to detect mailing loops
gullible: 0 # If NZ, don't validate 'From' fields
bitnethost: cunyvm.cuny.edu # Relay host for '.bitnet' rewrites
poll: 10 # Seconds between queue polling cycles
scratch: C:\xampp\MERCURYMAIL\Scratch # Where we can write temp files
returnlines: 15 # How many lines of failed messages to return
postmaster: Admin # NetWare UIC of postmaster
broadcast: 1 # Yes, we want broadcast notifications, but
receipts: 0 # ... no broadcasts for receipt confirmations
PM_notify: 1 # Do/Don't send errors to the postmaster
change_owner: 1 # Change message ownership to recipient
auto_tzone: 1 # If NZ, obtain timezone information from OS
LogLevel: 15 # System message reporting level
LogMax: 100 # Maximum number of system messages to store
RetryPeriod: 30 # Period between job retries (minutes)
MaxRetries: 16 # Maximum number of times a job can fail
TwoPasses: 1 # If NZ, process submission queue in 2 passes
Autoaddress: 0 # If NZ, auto-generate user addresses based on name
Daily_exit: 0 # If NZ, auto-restart each day after maintenance
No_Areply: 0 # If NZ, disable automatic replies system-wide
Alt_Forward: 0 # If NZ, allow alternate forwarding specification
Maint_hour: 2 # Hour for daily maintenance (24-hour clock)
Maint_min: 0 # Minute for daily maintenance
Retry_Mode: 0 # If NZ, use progressive backoff for queue retries
[MercuryC]
# Session_logging: G:\ # Directory to write session transcripts
host: # mail mail host which relays for us
scratch: C:\xampp\MERCURYMAIL\Mercury # Where we can write temp files
poll: 30 # Seconds between queue polling cycles
returnlines: 15 # How many lines of failed messages to return
failfile: C:\xampp\MERCURYMAIL\Mercury\FAILURE.MER # Delivery failure template
esmtp: 1 # Yes, we want to use ESMTP extensions
[MercuryE]
Poll : 15
Timeout : 60
# Session_logging : o:\mail\mercury\melogs
# Session_logmode : 1
# Nameservers : 139.80.64.1
[MercuryD]
scratch : C:\xampp\MERCURYMAIL\Mercury
# Timeout : 30
# Poll : 120 # How often to check hosts for new mail (seconds)
[MercuryS]
# Session_logging: G:\ # Directory to write session transcripts
debug: 1 # Whether or not to show session progress
# allow: 192.156.225.2 # A machine we WILL permit to connect
# refuse: 192.156.225.0 # A group of machines we WON'T permit.
logfile: C:\xampp\MERCURYMAIL\Logs\MERCURYS.LOG
# size: 1500000
Relay : 0 # Control non-local relaying
[MercuryP]
Scratch : C:\xampp\MERCURYMAIL\Mercury
Stack : 32768
Mark_Read : 1
SSL_Mode : 0
Login_Disabled : 0
Timeout : 60
[MercuryX]
# Cmd_Delay: 10
# Cmd_Wait: 1
# IE4_Dialling: 0
# Use_ETRN: 1
# Clients_only: 1
# Sunday: 0800,1800,3,15,30,60
# Monday: 0830,2100,5,15,60,60
# Tuesday: 0830,2100,5,15,60,60
# Wednesday: 1500,1900,2,30,5,30
# Thursday: 0900,1900,2,30,0,0
# Friday: 0830,2100,5,15,60,60
# Saturday: 1031,1035,2,45,-1,0
# [Groups]
# testgroup : TESTGRP
[Domains]
# NetWare Server Domain name
localhost : localhost
localhost : localhost.net
localhost : localhost.org
localhost : localhost.com
[Maiser]
Maiser: Maiser # 'Username' of mail server account
Helpfile: C:\xampp\MERCURYMAIL\Mercury\MAISER.HLP # Help sent on failed maiser requests
Lookupfile: C:\xampp\MERCURYMAIL\Mercury\MAISER.LKP # Format file for the 'lookup' command
Send_dir: C:\xampp\MERCURYMAIL\Mercury\SENDABLE # Directory for the 'send' command
Logfile: C:\xampp\MERCURYMAIL\Logs\MAISER.LOG # Mail server log file
Notify: C:\xampp\MERCURYMAIL\Mercury\TMP # Dir. for pending 'notify' commands
NoList: N # If 'Y', disable the 'list' command
Local_only: Y # If 'Y', local 'notify' commands only
[MercuryH]
Logfile : C:\xampp\MERCURYMAIL\Logs\MERCURYH.LOG
# Addressbook : \\CLIO\SYS\SYSTEM\MERCURY\PH.PMR
# MOTD : \\CLIO\SYS\SYSTEM\MERCURY\PH-MOTD.TXT
# Administrator : postmaster@clio.pmail.gen.nz
Timeout : 30
[MercuryI]
Scratch : C:\xampp\MERCURYMAIL\SCRATCH
Timeout : 120
Server_Port : 143
Idle_Timeout : 1800
SSL_Mode : 0
Login_Disabled : 0
[MercuryB]
Scratch : C:\xampp\MERCURYMAIL\SCRATCH
# Logfile : o:\mail\tmp\mercuryb.log
Timeout : 120
Server_Port : 80
# Session_logging : o:\mail\mercury\mblogs
# Session_logmode : 0
Idle_Timeout : 1800
# URL_Base : enter_your_domain_here
[Groups]
[Rewrite]
[Statistics]
StatFlags: 0 # Statistical reporting settings
STF_Hours: 24 # How often to write stat log files
STM_Hours: 24 # How often to e-mail stat log files
I need to mail as well, i do insert it into a table at the same time based on the results of the email being sent. Its just an easy way to stop web bots signing up and causing havoc in my db straight away. At least this way they can only get so far.
I noticed at about line 127 of the original mercury.ini that it has [Domains]. Is that something to go on?
execute C:\xampp\MERCURYMAIL\Mercury.exe
1) under configuration / protocol modules - enable mercurys module
2) under configuration / manage users - create an user account
3) safe and restart mercury and see if you can send mail to it. I'll probably respond with an error message, but first things first.
noticed at about line 127 of the original mercury.ini that it has [Domains]. Is that something to go on?
You just can use localhost or an IP number. That is as long as you want to use it locally.
city_coder
05-30-2008, 11:18 AM
Well for starters i dont have a mercury.exe but i started it through xampp.
Then all of the protocol modules are already running but couldnt find a 'mercurys module'
When i create an account, what account am i creating? my email address that i already have that im testing with? 1 thats completely new? 1 for mercury only?
city_coder,
you're a funny person. If mercury.exe isn't there, mercury wouldn't even start.
You should uncheck all modules except the first one (mercuryS).
One for mercury only. Since you don't have a domain, you need to create a mercury only account.
city_coder
05-30-2008, 01:50 PM
haha cheers, i am quite proud of my inability to follow instructions and my ability to make jokes, especially my slap-city_coder jokes!!! haha get it? slap-city_coder? like slap-stick? no? well i found it funny
ok i unchecked all the boxes except for MercuryS SMTP server
ok this mercury only account is what? the sending account? the receiving account for testing? the im really lost account?
i take it its the sending account and if so, how does that help with my mail going through. how does it know to send it through mercury?
Sending/receiving doesn't matter, but in this case you need to think of receiving.
Ok, you need to add an alias to that account otherwise you can't send locally.
I take it its the sending account and if so, how does that help with my mail going through. how does it know to send it through mercury?
patience, patience, all in good time
city_coder
05-30-2008, 05:40 PM
Right ok, whats an alias?
when i go onto add aliases, i have alias and real address.
what goes in what? an example would be great cos this bit just confused me. sorry :S
Right ok, whats an alias?
when i go onto add aliases, i have alias and real address.
what goes in what? an example would be great cos this bit just confused me. sorry :S
I questioning myself now if you need an alias! You normally would use an alias instead a full email address when mail is local. But since you don't have a domainname all is local. But this will work
alias account@localhost
real address account.
Of course account isn't taken literally; but the account you made. But try without too. Now make an new account in your favourite mailclient with the ip address of the mailserver (smtp/pop)
city_coder
05-30-2008, 06:28 PM
so if i put in alias account:
account@localhost
and in real address account:
email address that i use in real life
and why do i have to create an account in a mail client? because i need to set the ip address of the mailserver? what is that address? how do i find that out?
so if i put in alias account:
account@localhost
and in real address account:
email address that i use in real life
and why do i have to create an account in a mail client? because i need to set the ip address of the mailserver? what is that address? how do i find that out?
city_coder,
I'm worried about you:D. Before I answer; are you using a single machine or using a separate one? Because that makes a difference.
city_coder
05-31-2008, 08:40 AM
lol yeah well the way i learn is through examples and telling me why things happen at each stage and we havent done it that way so thats why im asking so many questions.
yeah only the 1 machine. but i will be asking how to do it with 2 machines later :D
When it's on a single machine forget about the alias. You won't need it.
and why do i have to create an account in a mail client?
What point is there to mail the message if you won't fetch them. Another reason is to test if your mailserver is working. Ok, you're good to go.
Load up your form and see if your php file inserts it into the database and sends mail to mercury
city_coder
05-31-2008, 11:47 AM
Ok nearly good to go, i havent set up the mail client yet. Im gona use outlook express as thats just installed obviously
What address do i put in? the address that im putting into the form? Also what is the IP address of the mailserver? how do i get to it?
Since it's on the same machine you can use localhost
city_coder
05-31-2008, 01:06 PM
ok so my fake email account is account@localhost on outlookt express
then it wants me to choose my incoming mail server:
POP3, IMAP or HTTP
which one?
then it wants me to enter my incoming mail server, what goes in there?
also u didnt say what/how i can get my IP address of my mail server!!!!!!!!!!!!!!!!!!!!!!
ok so my fake email account is account@localhost on outlookt express
then it wants me to choose my incoming mail server:
POP3, IMAP or HTTP
which one?
then it wants me to enter my incoming mail server, what goes in there?
also u didnt say what/how i can get my IP address of my mail server!!!!!!!!!!!!!!!!!!!!!!
HAHA, Oh man you remind me of my best friend. Sometimes I am puzzled why he is asking noob questions. So what I do; when he leaves his pc I install the programs he wants. When he asks what I did I just say I can't remember.
Anyaway. POP3/SMTP all are localhost. No need for IP for anymore (single machine).
He city_coder,
Since you didn't ask anymore i assume everything is working now? I hope you weren't offended by my last post.
TheJoshMan
08-03-2008, 04:29 PM
I do believe you are pointing the finger of blame in the wrong direction on this one... The reason you are not able to send an email via "localhost" is not because of xampp. I use it all the time, you must first contact your ISP and get the SMTP settings from them. You'll need POP3 settings from your server you host through, and SMTP settings from your ISP as they almost always have their own settings that they never bother telling anyone about.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.