XAMPP Mail sending on Mac - php

So something interesting I encountered while working on my site. I use Xampp on a mac OXS Lion to run my website. And I have mail() functions in my code that never worked (sent outgoing mail) before while I was connected to my home internet connection (Verizon Fios).
However, I was recently at a local hospital and logged onto the internet through what seemed to be an unsecure internet connection. While I was working on my site, all of a sudden the mail() functions started working and sending mail... But, when i got back home, it did not work anymore!
How can I figure out what was different, so that I can change some settings maybe in php.ini or maybe my computer configuration, so that I can get it to send mail, like it was doing at the hospital. I am trying to figure it out... any ideas?

Related

what properties should be set for my SMTP

I have setup a Website based on HTML with the exception of a contact.php page. I am hosting this website on my Rasberry Pi 3 computer on Debian flavor of linux Jesse Light. This is headless as it hosts my Portfolio website. I am using Apache2 webserver and installed sendmail as my Mail Transfer Agent (MTA). The problem is I have been spinning my wheels researching for the past week and I am stuck.
My issue is I send email from my php contact page on my live server but nothing ever arrives in my inbox after sending it. I get a mail sent message from my php script after about a minute after sending but then Nothing arrives in the inbox. I am thinking My SMTP on my php.ini is not correct. I put my website domain name FQ name. I am using Microsoft Exchange Online hosted email domain by GoDaddy. Also, anyone have any good advise on what my from / to should be set to on my SMTP configurations?
Sounds like a direct reject to me.
Some hints:
check the SMTP logs from your MS Exchange server (if a connection has been opened and potentially been refused for whatever reason)
check the PHP / Apache logs and see, whether an PHP fatal error or warning occured (mybad bad credentials or wrong port?)
I have had bad experiences with MS Exchange server and SMTP, make sure its proper setup.
check the credentials and settings from an independent client to see if they work flawless.
Hope that helps. Otherwise please provide more details and log samples.
Is your contact.php program hosted on the Godaddy server? If yes- It's not possible to send mail through Godaddy shared hosting servers using your own SMTP settings. You can only send from Godaddy's relay server when using a shared hosting plan. If you wanted to be able to send through your own SMTP servers, you'd need to be hosting with either a VPS or Dedicated Server plan.
Check maillog on your server and you will get the smtp connection timeout errors.
Let me know, in case the problem is something different- will try to address it.

How to test PHP send mail on local server with MAMP Pro

I have a small web form that on submission triggers a mail script that sends an email to the address given to verify their email address.
I want to test this on my local server using MAMP Pro. I am totally confused from the info I have sourced that holds different advice and requirements.
I use Dreamweaver (DW) with WebAssist (WA) extensions to build my PHP scripts and when I contacted WA support to ask how to enter the correct settings with their DW plugin to work with MAMP pro they told me..
To have your localhost send email you need to install a local SMTP server configured for email relay.
If you want to use a remote smtp server you would likely have to use the PEAR mail option for authentication.
This has thrown me as I can't see anywhere in any MAMP Pro documentation about having to install SMTP servers and I know nothing about PEARL.
The following Blog makes it sound simple..
http://blog-en.mamp.info/2009/09/how-to-sending-emails-with-mamp-pro.html
But it obviously isn't as I have tried these Postfix settings with know joy.
I have also seen this post..
Test emails locally with mamp
..that gives a method using gmail but I just can't make sense of it as It appears that the MAMP interface may have changed since this was written.
Plus I am not familiar with using Terminal.
If anyone can shed some light on this to point me in the right direction I would be most greatfull
You can use Mailhog to achieve this. I wrote a tutorial on Medium.
Install mailhog using Homebrew (if you don't have Homebrew installed, check out the instructions here: https://brew.sh/):
brew install mailhog
Open MAMP Pro and go to the “Postfix” tab. Make sure the checkbox next to “Include Postfix service in GroupStart” is checked.
Use these setting for Postfix:
Fill in your domain name in the field “Set domain of outgoing e-mails to:”
Check “Use a Smart host for routing”
“Server name:” is 127.0.0.1:1025 (this is the SMTP port Mailhog uses)
Set “Authentication” to “none”
Go to http://127.0.0.1:8025/ in your browser to see the mails sent by PHP.

'Test Mail Server Tool' only working in certain cases?

I'm currently using Test Mail Server Tool to send emails through the locahost server I have set up (WAMP).
For some reason, the first two e-mails I send work just fine (they show up in the received mail folder), but the other email that is sent from a different PHP file never shows up or mails. The function was working just fine, I didn't change anything. I even did some debugging to see where the code was going wrong - it goes right up to the function and then just doesn't work.
However - when I put the files on another computer, the function seems to work just fine. I made sure I have Skype and any other messaging service that takes up ports closed. I tried restarting my computer, restarting WAMP server and the tool, nothing seems to work.
Any ideas?

not even with mail or phpmailer can send mails

Hy !! i have a big problem, i have an Ubuntu 10.10 with php 5.3.2, I use phpmailer to send mails and the function works like a month ago. But know, it just said, SendEmail with the php mail, or with the phpmailer say's send!!!
The messages never arrived!! with the 2 functions, i dont know if the php.ini get moves , or somethings else.
All scripts were tested in other servers ( digital ocean ) and they work perfectly.
But know in this server, is not working.
The time I execute #linux: mail.php , its inmediatly, and send my message " SEND MESSAGE".
In Gmail, I already check if where at Spam , but they neever arrived.
No firewall, Ubuntu 10.10, phpmailer lasta version, php 5.3.2
i check with a Python Script with same configurarion in the same system and works!!!
but with php nothing works!
Please help!!
You need contact the digital ocean support and open a ticket. Same happened to me and I found that they have a block by default for new accounts (to avoid spammers). You need open a ticket ans inform your situation.
When I do this, minutes after they check some information and my mail start to work :)

gmail settings for sending mail on mac

I'm using mac OS snow leopard, and i have probs with mail, i'm not sure is it something about gmail, or php mail() func.
It's not working. I wrote it this way (just for testing ).
mail('something#example.com', 'My Subject', 'My Message');
I done * i need with postfix configuration, but it's not working (can't get the mail).
Any help, just need explanation on how things work. I'm googling last 3-4 hours, but nothing (didn't find the right answer). And yes, i'm using local server.
Thanks!
If your application is hosted in local host the mails will not be able to send. Upload to a live server and check it. (You need a mail server to send the mails)
Just a tip - if something isn't working, try and find the problem withing your code before blaming gmail or php functions. These have been tested and re-tested in live environments by literally millions of people.
Do you have a mail server installed and configured? Do you have Apache sendmail enabled?

Categories