i want to send mail via php mail() function.
now i need to install SMTP server on my computer for this one work.
i donwloaded the hMailServer, but i dont know what i need to setup there.
also, what i need to setup in the php.ini file?
i read some tutorials while searching google, but didnt work for me.
i dont want to use phpMailer with Gmail SMTP server, i want to send it from the SMTP server that found on the server.
also, before i was tried to setup send mail in php.ini, maybe i change there somthing and now i need to change it back, so i dont know what to change back, please tell me all things that i need to define for hMail will work...
Related
I am trying to receive mails in my local server running XAMPP. I have Mercury and outlook configured and running according to this: http://system66.blogspot.in/2010/01/how-to-send-mail-from-localhost-with.html
My goal is that, I must be able to send a mail from xyz#somedomain.com to someaddress#localhost and I want to parse the received mail and store it in a MySQL DB.
I saw many references telling how to send mail from localhost (using gmail's smtp server using sendmail) but I dont find any resource telling me how to receive mail from anyone onto my local computer. Once I receive the mail to my PC, I can parse it and store it in DB. The only problem is getting the mail. Please help me out.
PS: I have configured php.ini and sendmail.ini files for doing the operations.
Firewalls are disabled and ports are available.
If you dont understand my question, imagine my pc as a mail server which is trying to get the mail sent to xyz#myserver.com
UPDATE : You need to configure DNS for your mail server. Take a look at this. Hope it would help.
You need to open port in your router & PC firewall in order to get requests from outside and a mail server.
I have a contact page that I made following this tutorial, when I click send I get a message telling me that the message has been sent, but I ain't receiving any email, I'm trying to test it locally with xampp v3.1.0, I read that I have to change the smtp in php.ini, but it didn't work either.
I want to test it with my localhost, what do I have to do?
As can be seen in the link "Mail" in XAMPP homepage (i.e. "localhost"), with the default configurations of the XAMPP, mails sent by the php mail function can be found in ".../xampp/mailoutput" folder (Windows). This is useful for test purposes.
Maybe your change to the "php.ini"s SMTP directive can be a problem to this approach.
You often don't have mail capability from your local server unless you specifically set it up that way. If you want to be able to send mail locally, refer to this link. Of course, there are other ways, such as installing hMailServer or some other smtp server, but you should have sendmail as part of your Xampp installation.
I have spent the last 15 hours trying to figure out a simple, free way to send a simple text email via a php script when a form is filled out on a html page. I don't care how it looks, as these emails are only going to be sent to me (at most 15 a day). I don't need anything except a simple email to me when the form is filled out. I understand everything except I cannot get past:
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini
What i have tried:
Playing around with the pear mail extension and using smtp.gmail.com
Downloading countless smtp mail server applications.
Using my ISP smtp and port 25: smtp-server.wi.rr.com.
Using PHPMailer.
Using the windows SMTP server.
Although all of these things should work... I am apparently too dumb to figure it out. I have read every sentence on the subject on the internet and have tried to follow instructions, but each time I try something else, I just run into more problems. Someone PLEASE give me a simple fix to this, so I can never look at PHP mail stuff again.
If you're sure all these settings are correct, you should check your firewall. If all else fails, try sending a mail from a mail client (or make an attempt using Telnet!). If this succeeds, than you're doing something wrong in the PHP configuration, or the way you send the e-mail. If sending fails with other clients too, than the problem lies in the ability to send e-mails from that computer at all.
Your own ISP should work fine. Remember that most ISP's don't require you to enter a password. Only the smtp server will suffice in that case.
Folks.
After many hours of trying I found that:
You don't need additional tools like mailservers or pear additions. These only provide additional potential security leaks that you have no control or insight over.
To get mail function to work on localhost, all you need to do is change the php.ini file.
I just checked my outlook account settings and copied those to the php.ini file.
So SMTP server, port, username and password.
Now,
You may think it does not work but
You should know that many mail clients reject emails if the From field has a different domain than the actual domain an email is received from.
So if the php.ini file contains for example
smtp.ziggo.nl
Be sure that the header contains:
From: info#ziggo.nl
So for making universal code on both localhost and remote host, I check for the existence of a file that I only have locally (e.g. z_local) and set the headers accordingly. If the local file does not exist I must be on the remote ISP and choose the header "From: info#remotesite.com"
I just installed XAMPP, Apache is running, so is MySQL and Mercury.
In Dreamweaver I created a php file with a mail($to,$subject,$msg,'From:'.$email); function, but when I ran the file from localhost it showed an error. After playing around with xampp control panel, turning mercury on and off, it's not showing any errors, yet is not send the email either... any ideas?
the 'admin' button on the cp for mercury does nothing.
Thanks!
R
You would have to configure the mercury server bundled with xampp to actually deliver/relay the mails.
But I suggest you use something like SwiftMailer instead of php's mail() function.
edit: there is a third option. The mini-smtp-client built into php/win32 can't do authentication. Therefore you can't simply put SMTP=mail.gmail.com; smtp_port=25 in your php.ini. But you can set sendmail_path and point to an application that can relay the message to another smtp server (including authentication), e.g. fake sendmail.
(But I still suggest swiftmailer)
You do not need to use a SMTP server like Mercury to send mails from your PHP.
I personally used two days on this matter, now expert in Mercury, almost, since it never worked with PHP.
Save a lot of time and use SWIFT MAIL, standalone solution, no SMTP server needed - the first example at this link works ! Swift mail is very elegant. Only needed is to download and add the lib folder in your php path. When the mail with the message "Wonderful Subject" ticks in the mailbox at first try, it is indeed a wonderful lib.
http://swiftmailer.org/docs/sending.html
You have to set your SMTP server settings in the php.ini file
i have just succesfully installed open atrium, but i can't find the configuration of the mailserver... i currently cant send any mails because there is no SMTP Server defined, an without mails being send, no new users can be registered, because they recieve their pasword via mail...
i hope that somebody can help me :)
Assuming Open Atrum works the same way as drupal this should help in short:
Set up a mail server locally
change your php.ini settings to point to a mail server
You should probably be using the SMTP module.
According to the OpenAtrium Installation docs, all you need to do is enable the [standard Drupal cron job]. That worked for me in my OpenAtrium installation. Just to be clear, I did not have to alter php.ini or install the Drupal SMTP module.