I am using php and Codeigniter, I need to implement the following schema
for list of emails I need to send emails for them, and if they reply to this email, I need to know if the reply and what the content of this reply and view it using my php project.
Also I need to send them a multiple choice question and they have to chose one option as answer, and then check this answer from my php project.
I can send email from my gmail, but can't send it from the wamp server itself.
Any help?
I'm not exactly familiar with CodeIgniter, but if you want to send an email, and it doesn't work, especially on Windows the common problem is that there is no SMTP server configured.
Most *nix distros have some form or another of a SMTP server running by default, Windows doesn't. When unconfigured PHP assumes localhost to be an SMTP server.
This SMTP server is what PHP needs to be able to send emails, so you'll either have to configure one or find one you can use that's provided by someone else.
For using PHP's native mail() function and any library that relies on it the configuration entries you're looking for are SMTP and smtp_port. (Have a look at: http://php.net/manual/en/function.mail.php)
It might very well be that your ISP provides a SMTP server. Otherwise you can always set up a gmail/hotmail/whatever account and use their SMTP settings. This is usually far easier than setting up your own server.
If you choose to set one up yourself, you'll want to look into SPF, so your messages don't get marked as spam by default.
Related
I've tried using Postfix only as a SMTP server for sending "verification" mails locally, to any provided destination. The current problem is, it sends all mails without any issues but receivers don't get them.
I'm using XenForo software with "127.0.0.1:25" SMTP data for sending mails, without user - / pass login because Postfix is locally bound and should only send mails - not receiving any from outside.
Also I'm using my custom domain to provide "from:" data for mail. (e.g. "no-reply#*******.com")
I already tried using SMTP servers of different hosts such as "MailJet" but I had the same issue there. The staff of used hosts said, there'd be something wrong with my server and nothing else, so that's why I had decided to host an own SMTP server locally on the same server as like as my webserver's running.
Postfix "main.cf" file: http://pastebin.com/r8EfKbXL
Logs: http://pastebin.com/TnjVbNfp
Thanks in advance.
Sincerely,
Chris
And you have SPF, DKIM, etc. all sorted? I suggest you (authenticate with and) use the same SMTP server you use for all other email from that domain, create a separate inbox if you need so it's using different credentials to you. It's usually a lot less hassle.
I'm developing a Web application with PHP 5.3.3.
I want it to send confirmation e-mails automatically.
I don't have a domain name yet.
I'm using Windows XP.
I don't have PEAR's Mail package.
I have hMailServer and is the mail server I want to use to send the e-mails.
My questions are:
Can I send e-mails without a domain name? (Is it absolutely necessary? I just want to test the application for the moment.)
If a domain name is necessary, do I also need to host the application with a Web Hosting Service Provider? Can I do it from my computer?(Remember, I just want to test the application.)
Do I absolutely need the PEAR's mail package? or can I simply use the mail() function?
I'm clueless about what I should do. I've made my research, I understand the parts but I can't make sense of the whole, I mean what resources are necessary and how to put it together. I've never developed any application that sends e-mail before. Please, help me.
Yes. You can set your "from" address to whatever you want. (Though note, the recipient server might detect it's forged and reject it.)
You can host from you computer, just make sure your network is not blocking port 25 outbound.
mail() alone will suffice as long as you have a local SMTP server that will handle your messages. (I'm assuming that's what the hMailServer product is.)
First off, if you're running Windows as your server, you need to configure how your e-mails will be sent (SMTP server). Go to this section in your php.ini file. Change localhost to an SMTP server you can use from your network (either the IP address of your hMailServer OR sometimes you need to purchase one to use like http://www.smtp2go.com/).
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
Second, you use the mail(...) function in php (including the ability to send HTML mail). That's it.
Yes, you can. I believe your emails will show up with your server's DNS by default, but you can set the from: header to whatever you want. However, if you change the from: header, be warned that your emails are likely to get picked off by spam filters.
You need some special server configuration to use the php mail() function - I haven't tried setting it up myself, but I know that a basic local apache / php install won't have the capacity to send emails. Pretty much every paid web server should have it set up properly, though.
No. You can send regular and html emails with the generic mail() function.
I'm coding in PHP w/ CodeIgniter and I'd like to test some of the features in my app that send emails.
For some reason, I couldn't send emails through my email account in my local server (XAMPP), and I also don't want some SPAM filter to think I'm spamming while I'm testing.
So is there any email service that I can use for testing purposes? preferably one that doesn't enforce SSL, since I have problems getting that to work on my local server.
Appreciate your help.
As long as you're not sending out dozens or hundreds of test E-Mails, use whatever your everyday E-Mail provider is (e.g. GMail). Set the SMTP server of your mailing function to point to Google's. (I think SSL is optional with GMail, but I may be wrong.)
If your mailing library doesn't support using an external SMTP server, switch to a different one. But I think CodeIgniter has you covered there.
If you just want to test the application functionality, check out Papercut. This utility simulates the sending of email without having to set up a mail server, works great!
edit: had wrong link.
I like to set up a test SMTP service on my development machine and just send to that. There are several good options listed under this question.
I have some problems with the email system for CodeIgniter:
First, the emails I send out (registration, confirmations) are getting caught in standard spam filters in gmail and other mail clients. How do I get around this? How do companies like Facebook get their emails through consistently?
Second, the mailer is working locally but once we deploy it it no longer runs (doesn't send emails) but all the other forms run just fine. Anyone ever run into a problem like this?
Thanks for all the help!
I can't really answer your first question - it's not specific to CodeIgniter. You just need to make sure your email doesn't look like spam. In short - there's no way of guaranteeing your e-mail will not end up in a spam filter.
As for the second question, I expect your production server needs to be configured properly for email. You probably need to configure CodeIgniter to send email properly. I would suggest setting up an SMTP server (or using an existing one) rather than using the standard PHP mail which I think CodeIgniter uses by default.
Regarding spam, most organisations are very secretive about how they prevent spam (not wanting to publish information which helps the spammers) and in some cases they don't actually know - an obvious examlpe of this is bayesian filtering - but, for example, hotmail use a completely unaccountable army of volunteers to manually classify emails.
Do and get a copy of spamassassin and try to reverse engineer how the standard rules work. Obvious things to check are:
1) AVOIDING LOTS OF CAPITALS
2) don't mention the 'V' word
3) make sure you've got a current and restrictive SPF 1.0 policy published
4) make sure your sending from an address which has A and PTR DNS records
5) Do provide a reply-to and from email address which use your domain in the address
the mailer is working locally but once we deploy it it no longer runs
doesn't send emails
Which? These are 2 totally seperate things. If the code is falling over (if so why have you not provided the error details) then its likely a PHP version issue or a problem with the connection to the MTA (or the PHP mail config).
The latter is a problem with the MTA itself.
99.9% of problems reported as PHP mail failures have nothing to do with PHP and are problems with the MTA.
Enabled detailled error reporting for your MTA and see where it is failing.
C.
You may have to configure the email on your server differently than your local development environment. I've had to in the past.
There are two basic ways that PHP can send mail:
Via a UNIX program called "sendmail" (only on non-Windows servers and only if it is installed - check with your hosting provider)
Via a SMTP server.
If you've configured CodeIgniter to use SENDMAIL, check to ensure that the Sendmail path is correct. Your hosting provider usually provides this somewhere in their online documentation.
If you're using SMTP, you need to make sure that your server can contact the SMTP server. You can do this by logging into the server via SSH and typing "telnet your.smtpserver.com 25". If you get an error message about not being able to connect, you know you have a problem with your hosting provider connecting to your mail server.
I've been able to diagnose this problem by enabling logging on my production server (http://bit.ly/4pprd6) and adding log_message('error', $this->email->print_debugger()) right after I attempt to send a message.
I have two dedicated servers, one of which is configured for sending email out (SPF, DKIM, other domain whitelisting methods, etc). I need to send email from both servers, but I want to send mail from both servers through the server that's been set up for it.
It doesn't look like I can explicitly set an SMTP server directly in the mail function. Is there a way I can override the value set in php.ini, through .htaccess or something?
I would recommend not using the mail command and using a pre-built PHP mailing solution. There are 2 great recommendations at the following: Is this the correct way to send email with PHP?
In using a pre-built solution, you can have all of your mail go to the same server if you choose.
I would recommend using ezcMail for sending emails. It has a clean object oriented prebuilt mailing package which is highly configurable.