Setting a website server with mailing service - php

I have this job creating a simple website for someone, a website that
should be able to send mails to any email address, and I'm having some trouble
making it happen.
I'm using a simple free file server (cuccfree), but I don't have access to the server itself, only to upload files to the htdocs folder. I also configured a mail address in my server, but mailing only work to the server's email address (When ever I ask the php file on server to send the mail to Gmail/Yahoo and such, it does not work).
I've searched Google for an answer but kinda got lost..
I'd really like some help about this:
I'm ready to switch to a better file server service (whether it's free or not) that can support configuring mailing service that would work, and would be glad to hear some suggestions for one.
I'd also love to be guided of how to configure the mailing service on that server.
Also, when thinking about this, there's a good chance that my server's mails are being blocked by Gmail/Yahoo and such, otherwise anyone could have just set a mail server and send as much mails as they want.. so is that possible that this is my problem? is there any way to solve this and kind of confirm with the mailing companies that I'm a legit website?
I'm really not familiar enough with this topic' and would really appreciate some help.
Thanks in advance!

Related

Using an external email service to forward mails from WordPress

I run a reasonably popular blog on WordPress and have a fair number of comments forwarded to me by the mail server currently sitting on my web server. However, I am in the process of moving to a new server where I do not want to run a mail server. For all my other site needs - user registration - I am doing this by forwarding all emails sent out by the system to a transactional mail service that handles email forwarding a whole lot better than my local mail server can.
I need to modify the WP code that alerts me by email each time there is a new comment on a post. I assume that this is being done via PHP's mail function or the like. I tried grep'ing all the *.php files on my WP blog for this but found little.
I am a competent PHP programmer so hacking the relevant WP PHP code to redirect all mails via my chosen transactional email provider holds little challenges for me. However, I would be most grateful to anyone who might be able to tell me just where WP does its email sending - perhaps it does not use the PHP mail function as I have been assuming.
Here is an answer to my own question.
After some more research I have eventually found this. As explained there WP sends its email via the wp_mail function which is located here.
I hope that this answer will help anyone else who wants to replace local mail server based email handling with forwards to an external mail/transactional mail service.

Mail going to Spam in gmail

I have a running store, but my emails are going to spam.
I have Joomla 1.7 installed and configured it tu use proper SMTP auth.I have the site running on a shared host.
I have tried to search in email blacklists but it all comes clean.
Am I doing something wrong? Any ideas?
Thanks
You probably need to configure SPF records for the domain, You should contact your host and ask them to configure them..
I had this same problem on my web site. :)
This is complex issue, First of all, you should follow the following tips
Tell the people who receive the mails, why they get these mails (at the footer)
Give them explicit link to un-subscribe from this list (at the footer)
Make the subscribe process double opt-in, so after adding their mail, they should activate through a link sent to their mail
Also Read the following links that may help (You may need help from your server administrator)
http://en.wikipedia.org/wiki/Email_authentication
http://en.wikipedia.org/wiki/DomainKeys_Identified_Mail
http://mailchimp.com/about/authentication/
Finally, the best think to avoid your mails getting blocked is to make sure that your users want them .
Joomla 1.7, 2.5 and 3 all feature a mail file which sends the mail without the plaintext alternative, this was killing my sites. I had to add it manually to the core, please see Joomla mail goes to spam folder: how to add text/plain when sending HTML email?

Receiving emails, processing them and saving them on the database of my web application

I need in some way to accept incoming emails to my web application and save them in the database. My web application is written in PHP language and im using MySQL database.
I have no idea how can i do that... I builded the rest of my web application by myself but this is very complicated for me.
For example i need to know how can i accept incoming emails first... and where? in which email address my web application will accept these emails...???
Then how i will get them from there? How i will process them and how i will store them in my database?
Please help me with an example, some piece of code, anything!
Any help is accepted.
Im not an expert so a piece of code will help me a lot.
Thank you in advance!
You basically have two choices:
Run an SMTP program (such as Postfix or Sendmail) on your server to receive the emails, and use procmail to pass them to your code
get an email account on an external host service and retrieve the email using one of the POP3 client packages for PHP, such as pop3class
Option 1 is much harder to do, and you have to learn about administering an email server, which is not a trivial task. Option 2 is relatively easy and is the one I'd recommend.
Easiest way would be to setup a regular email address with some freemailer and then check this account.
A start for this might be the POP3-class of PHPMailer.

How to get the Reply Emails ? Need a Mail Server?

As i'm knowing just about PHP and don't know at all about Mail Servers, what i want to know here is:
How can i get the "Replied" emails (from the receivers) for the mails i've send (by using PHP, with a address like xxxxxxx#gmail.com)
Does it need to setup my own Mail Server?
Unless using own Mail Server, is there any other easy way?
Honestly i'm not well understanding over IMAP or Email Protocols. Doing setup my own IMAP Server is far worse. Can it be done simply with a Web Hosting which supporting IMAP protocol? Or do i need to setup manually out from the start?
To be brief, i need a simple guide.
You only need a mail server if you don't already have a place where those reply-tos end up. Which adress are you sending them as? Where would you fetch the emails for those adress? You can ask PHP to log into any mail server that you'd fetch your emails from manually as well, so there shouldn't be a problem. But maybe I'm not getting you right.
Simply put the reply address to an email you own. For the example you gave to work, you would need to have the xxxx#gmail.com account.
Most people use something along the lines of mailer#youdomain.com, ans then create an account for that on their ma8lserver.
If you want to use your own domain, you don't need to run your own mailserver. Gmail, hotmail, and others have services that let you use their mailservers for your fomain, for free.

Sending a large email mailout through Gmail or maybe even Google App Engine?

I have a client that I'm wanting to move to a virtual private server. I'm trying to keep his server as simple as possible, not even having an email server on there (or at least that is the plan). The reason being I've read that email servers are complex to setup and take up alot of resources. I'm not sure what to do here.
He has a newsletter that he sends out to almost 75,000 people. Currently on his shared hosting there is a cron job that calls a script that sends out a 100 emails at a time (to keep within the limits of the host). I'm curious to know if the same thing is possible to do but with using his his Google Apps email account? Effectively logging in and sending the email from there? I can't seem to contact Google about this and it doesn't seem to be in their help section.
Is it possible? Would it be wrong to do? My client has looked at many of the mail out things out there (MailChimp, etc) but they are very expensive for what they are. Especially as what he has now does work. Thing is, I'm implementing the whole thing new on a VPS and so am looking at options.
UPDATE: It seems that the Google option just isn't an option (I'm not surprised by this at all). May I ask which minimal email server could be set up on Ubuntu 10.04 LTS which would allow me to continue the cron approach I had before on the shared server that will allow sending the emails out? (I will still continue to use MX records to Google for the actual emails the client will be using)
UPDATE: A friend of mine went to a mini Django convension in London the other week and there was guy who runs Mixcloud. He said he uses Google App Engine to send emails, so it's totally scalable. There is Google App Engine code up on Github here: http://github.com/tow/appengine-mailer and this seems to make sending email very easy from Django, from a command-line (so could use with PHP) etc. Looks like a very good option and cheap too! What do you guys reckon?
UPDATE: I've started a new question to make it more refined and clear to hopefully help others who maybe having this problem: Effectively using Google App Engine to send lots of emails using PHP?
There is a limit of how many emails can be sent per day through the google apps accounts. The limit is waaay below 75k I think it is 2k per mailbox if he has the premier account.
Two options here. Sign up with a company that does this for him: Constant Contact, Mail Chimp, ...etc. Or install an SMTP server and have it go out how it did before. The performance hit the server will depend on what mail server you choose and how much load is being placed on it.
UPDATE: I primarily work with windows servers so my experience is there (setting up secure SMTP in windows is pretty easy). Googled around and found this page on Ubuntu's site. It has a bunch of options for doing this: https://help.ubuntu.com/community/MailServer . From that page you should only need the Mail Transfer Agent and possibly the Mailing Lists components. Also make sure to set up your SPF records correctly and identify this server's IP as an outgoing only server. It can also help to set up the server with an MX record with a priority higher than your other MX records. If google goes down incomming mail will try to go to your VPS but as long as you don't set it up to receive mail, just send it, it will bounce the request. Which would happen anyway if your google mail servers go down so nothing lost.
Lastly you can try to register your server's IP with yahoo as a bulk mailer.
UPDATE2: Also make sure to have the "FROM" address in the newsletter be a valid email address from a valid domain. This will help immensely with deliverability.
UPDATE3: Can you get a static IP with a APP Engine Account? If you can't get an IP (preferrably dedicated) assigned to you then your deliverability will be horrible and you will get blacklisted. IF you can get a static IP assigned to your App Engine account you can set it up in your SPF records and that solution should work.
I did this a while ago for a commercial website. To describe it as an utter ball-ache would be an understatement. The amount of man-hours we sent working with our mails, enabling the various headers to avoid it being flagged as spam, to ensure that it looked to ISPs as valid mail etc was far greater than anyone envisaged at the start of the project. Then there are issues with mail throttling and throughput - at one point we were sending a weekly mailout that took 8 days to go through the entire mailing list.....with obvious results.
Anyways, upshot is, outsource it - there are many companies out there who have already solved this problem for you - granted you have to pay for them, but its cheaper in the long run.
You should use a third party site to fulfill this clients requirements. There are lots of technical, legal, and spam issues that need to be overcome to ensure that your client is not blacklisted or fined.
A company like Industry Mailout, MailChimp, or Campaign Monitor will send your mail for you, and is often a lot cheaper than trying to do it all yourself. :D
Plus these companies offer useful analytics to make your campaign's better.

Categories