Contact webform using PHP mail() or via SMTP? - email

I am modifying my website so users will be able to send an email through our webform.
Everything is written in PHP.
I will be using standard mail() function (PHP) and as I understand it will use local smtp server to send an email (this is sendmail, right?).
Should I maybe use SMTP server to send those emails?
I am asking because using standard mail() function it will use local server (Debian Linux 6.0) and I never really used it... I just want to be sure that all of those emails will get throu.

You have to keep some standards for sending emails in mind but then it will work fine:
set a RDNS entry for the IP you are sending the emails from
your email server must be not an open relay
don't send emails to users who didn't opt in to your email list via double opt in proceeder
your server IP need to be nowhere blacklisted
If you are sending a lot of emails (like 5000 emails and more) you should use a special service for that. A shared hosting plan or a VPS won't be a good idea for that amount of emails.

I always use PHP mailer. Its very easy to configure. Refer http://www.inmotionhosting.com/support/email/send-email-from-a-page/using-phpmailer-to-send-mail-through-php

Delivering mail is not an easy subject. If you don't want to dive into it, http://mandrill.com/ is a great solution. They offer a great free plan, and they manage all the deliverability issues for you.
We use Mandrill on all our new projects. We were using SendGrid, which is also good, but is more expensive (and not better).

Related

Send mail with sendmail to gmail

I have a server on OVH and I'm trying to send some mail to my Gmail address using sendmail.
I installed sendmail with apt-get on debian, and echo "Subject: test" | /usr/sbin/sendmail -v mymail#gmail.com works. However Gmail puts the mail in the spam folder and says the mail is not authenticated.
I have no knowledge of how email works and from what I've seen I could use SPF or DKIM to provide authentication, but it seems it requires admin access to ovh DNS servers.
What would be the easiest way, using only admin access to the server that sends mails, to make sure emails sent from it are not marked as spam ?
Thanks
There are no easy way. That's the simple answer.
Google Mail is fighting spam every second, every day, all year. To get mail delivered directly to the inbox requires time and patience and there are no shortcuts. If there where, spammers would have it way to easy!
You are very correct that Google's SMTP servers will ask you to beef up your SMTP mail headers to include better authentication and security. There's no way around it if you want to be on good terms with Google's SMTP servers.
Here is a list of things to consider
SPF (Must have, also to defend spam sent in your name)
DKIM (Must have, this is somewhat a step up from SPF)
ESMTP (Google likes it when you talk to them encrypted)
Bulk headers (Use them if it's bulk, no reason to lie!)
Unsubscribe headers (Use them if you are sending out maillist content)
SMTP relay's with nice Senderscores (Easy access to the inbox, but cost)
SMTP relay's with good reputation (Easy access to the inbox, but cost)
Feedback loop headers/setup (If you send large amount of mails)
Only use "warmed up" SMTP relay servers (Mostly used by bulk senders)
Reverse DNS to match HELO/HELO (Mismatch can make problems)
Static IP (It's a given)
As you can see it's no simple task to "just" send an email to Google and expect it to be passed along to the users Inbox without getting targeted as spam.
Most of the options above requires extensive server knowlagde or that your hosting provider supports it. You need to have access to change your own DNS records but also the SMTP server that you send your mail from needs to be setup with the things in advance.
Now to the:
"How to send emails to Google Mail that always land in the inbox for dummies"
Well you basically buy your way into the inbox. Use SMTP services like Mailchimp, Amazon AWS-SMS (Simple Mail Service) many if not all of these services have already setup DKIM, SPF and are on good terms with Google. They do however have many rules and what and what not to do so if you don't follow the rules they will close your account right away.

Is SMTP plugin important for WordPress?

I have a website based on WordPress.
Every page has his own Contact form.
I am using Configure SMTP
+ Contact7
(SMTP is setup to user Gmail as a SMTP server).
After a while I'm curious why I am actually doing it this way.
Is Gmail that secure or it is only about SSL?
Is WP build in mail function secure (and good) enough to use it?
In total: what is the best way to make contact form in WordPress and avoiding my mails getting to the spam folder?
I was told that the solution descriped above (Gmail SMTP) is the best way, is it?
Well, the build-in mail function works fine for most uses, like sending "Password lost" or "New user registered" mails or even contact forms.
If you send more than just a few (can´t name a number) mails via contact forms, newsletters etc. you will probably want to use a mailserver for that, either an external one (GMail) or a properly configured internal one. They go much easier past spam protection because they are known for sending mails and are probably whitelisted at the big mail providers. Your webhost most probably is not and might be considered as spam very fast when he is sending mails regularly.
If you want to send a lot of mails in a short span of time you should probably go one step further and choose a service like Mailchimp or something similar for that. Their business is sending newsletters and so nobody (means the mail providers) wonders, when they have lots of mails incoming from one of those servers.
For your use case I would stick to SMTP via GMail, when it works fine for you. As you are not sending lots of mails in a short span of time you´ll have only little problems with getting rated as spam and you also have a trusted server sending those mails. Seems fine for me.

Sending emails without Mailserver

I would like to know if there is a way how I can send e-mails with preferabel php or JS without needing an actual mail server. I am pretty sure it won't work, but have any of you an idea how there could be a way?
You can send mail with a lot of services, I believe they are called 'exchange' mail services. Gmail, outlook (or live, hotmail) are examples of these services. Google is full of examples :-)

Is there a reliable way to send email without having the senders smtp?

My application will be used in a manner that the user is remote from his computer running the application, receiving data via text messages sent periodically from the PC. Im sending the text message via email, using the number#carrierdomain.com. To simplify determining the user's smtp server, I've been sending the message using the destination phone carrier's smtp, instead of the whatever may or may not be available at the PC. This has worked so far with AT&T and T-Mobile, but not Verizon, as they have discontinued their smtp service.
I'm using mailsend v1.15 http://www.muquit.com/muquit/software/mailsend/mailsend.html
but Im open to alternatives.
I do have a less than ideal workaround, which is to use google or hotmail's smtp, but that requires a login/pass.
If I can send the text through regular email, using outlook, it works. I've looked at outlooks smtp logs, but that doesn't really help.
If its not being sent to a Verizon smtp server, how does it get routed, and is it something that my application can use?
Is there a reliable way to send email without having the senders smtp?
Theoretically, any smtp server can send your e-mail. However, due to the overwhelming amount of spaming on the internet, pretty much every isp has locked down their smtp server and will not allow anonymous relaying of e-mail.
If you do have the outlook client on the box you are sending the e-mail you can look at using one of the Outlook APIs:
http://msdn.microsoft.com/en-us/library/gg608200.aspx
to send the e-mail message. You are using the outlook configuration then and don't have to worry about it your code.
As long as an SMTP server is configured to allow relay from a remote domain then you can use it send email from/to virtually any address. There are downsides, however, to using any SMTP server to send an email from a specific domain - the most notable of which is that the recipient's domain will likely flag the message as spam because the domain of the SMTP server is different from that of the sender's email address.
There are other non-email APIs that can be used to send text messages, if that is something you're willing to consider. Check out:
Tropo (http://www.tropo.com)
Zeep Mobile (http://www.zeepmobile.com)
Best of luck to you.
Impossible. SMTP is the Simple Mail Transfer Protocol, without this is impossible to access to another account with Email format. You can make a php mail where you don't need to have smtp, but your access will be limited, not all ESP / ISP will allow you to delivery those emails, because they need to identify you using your SMTP and MX Lookup (Reverse MX A records) from your server. It exists more ways, but are 100% SPAMMERS and HACKERS methods and I don't recommend to use them.

cakephp email component emails go to hotmail junk folder

I am using the built-in email component of CakePHP 1.3, and it seems that all my emails go to the hotmail junk folder.
Does any of you know what to change to make Hotmail thinking this is NOT a spam? If some of you experienced the same issue, some feedback on what they've done or tried to fix it would be much appreciated.
Cheers,
Nicolas.
Cake simply uses the PHP built-in mail() facility. Without any further setup your mail is not going to be delivered by a proper MX server but rather the sendmail binary connects directly to the SMTP port on the remote host and attempts to deliver.
You see how easy it is to set up a spam sending facility like this. Mails delivered by a random machine instead of a proper mail server are very likely to be classified as spam.
Ask the web server admin to set up mail sending from the server. Alternatively you could use any trusted SMTP server to send mail (e.g. google).