I'm having trouble sending mail using PHP mail() on IIS 7 using Windows 2008 Server.
The server is dedicated, thus I have full control over my machine.
php.ini looks fine - ([mail function] is configured)
I don't get any error from mail() (with the right parameters of course)
btw - I got ASP and ASP.NET sending mails without any problems.
Would be very gratefully for help
Regards,
Roman
I use http://pear.php.net/package/Mail.
I am also having the similar issues
I have tried sending email thru telnet from IIS server
Now I am having problem that i couldnt send email even with simple PHP function - mail();
The php code that i use is
<?php mail("mail#rajanmaharjan.com.np", "hi", "test on today");?> doesnot send email to mail#rajanmaharjan.com.np
I have already read lots of forums regading SMTP setup in IIS and others
Related
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 a local server which host PHP applications. My applications send emails to different addresses. However, I am noticing a problem that I am unable to figure out. It send emails to internal addresses but it won't send messages to external addresses.
I also have an exchange server on the same network. so for example I have these 2 "internal domain"
domain1.com
domain2.com
if I execute this php function from my application it gets delivered with no problem
mail("name#domain1.com","Test Subject","Test message");
However, if I try sening a message to gmail, yahoo or any external domain it does not send it
mail("name#gmail.com","Test Subject","Test message");
My server is running on Windows 2008 Server R2 with PHP5.3.19 installed on it via IIS6
How Can I correct this issue?
mail() on Windows needs extra config in php.ini because Windows does not have Sendmail or anything similar.
The first is the SMTP setting which should point to your ISP's outbound server which is not necessarily the same server that you retrieve your mail from. When I worked in support there were a lot of issues like you describe because an inbound server will still accept mail, but only for the domains that are local to it.
The second is the sendmail_from setting, which is what the gimpy little mailer PHP wrote for the Windows distribution uses in every SMTP transaction regardless of what's in the headers. On *nix Sendmail will read the headers and get the From: address itself, on Windows PHP will always use what's in php.ini. If this is a "garbage" address like example#example.com or something with a non-existant domain many mail servers will reject it outright. What I recommend is to change it to something decent in PHP.ini as well as adding the following line to your mailing scripts:
ini_set('sendmail_from', $from_address);
Alternatively, just use PHPmailer since it simply works much better than PHP's horrid little mail() function.
I use PHP's mail function to send emails from my server, which currently also handles mail. However, I would like PHP to start sending messages through a different SMTP relay, not the server it's running on. I checked out php.ini, and it appears that it is only possible to specify a different relay on a Windows PC, whilst my server is running OS X Snow Leopard. Is it possible to change the relay settings? Ideally, I wouldn't want to incorporate anything new into my PHP code, as I use the mail function all over the place.
You cannot do this without either setting up a sendmail alternative on your server that routes mail through SMTP, or much much easier, using a library like Swiftmailer.
PHP does not have the capability to use an external SMTP server built in (Unless you are on a Windows platform).
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?
I am using php's mail() function to send an email from a php scrpit, however, this is not working. I believe the problem is with my php setup and the lack of an smtp server. Does anyone have experience with setting something like this up on a local machine and what can be done to fix this? Thank you
Yes I have on Windows machine. You should install local mail server, for example ArGoSoft Mail Server (www.argosoft.com). It's free, small and simple. Then setup a local domain in settings (for example weblocal.dom), then add a mail user (for example admin). So your test email will be admin#weblocal.dom. Then you just add this mail account to your email client program and send some mail to it from PHP script.