This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
how to make a php script that read an email from the server?
So I want an app to send the user an email, and the user has to respond. How do I capture what the user sent back to the email?
Check the In-Reply-To header of the reply to find out which message it relates to.
There are two possibilities:
Set up a regular off-the-shelf email server, and something to parse the inbox.
Set up a special php email server that listens on port 22 and processes the incoming mail - something like james but php-based. If nothing available you'll have to roll your own.
You have to create some cron job that will retrieve inbox of your email account.
I have implemented simmilar thing but I was using tokens system too - email that was send to user had a random generated token in topic. When user replied I was looking for that token and then associate it with some 'thread' (helpdesk system).
Related
This question already has answers here:
How do you make sure email you send programmatically is not automatically marked as spam?
(24 answers)
Closed 5 years ago.
I am trying to send a google login link in email body, but it always marks as spam.
The reason which i've found only is accounts.google.com, even though the 'google.com' also not. When i put account. in start of this; it goes to spam otherwise everything works perfect.
See the link and email body below.
$google_link='accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri='.$site_url.'&client_id='.$client_id.'&scope=email+profile&access_type=online&approval_prompt=auto';
$html.='<div>
Click here
</div>
';
wp_mail( $email_address,subject, $html, $headers);
Question: Is there any way to encrypt this URL in email body to send and it works proper in email/gmail inbox?
Is there any other way to avoid the email going to spam like marking specific email by it's subject using any third party mail sending tool?
You can use the third party service SendGrid by registering and installing their WordPress plugin. SendGrid process your email text and replace links with links to SendGrid such that the accounts.google.com will not appear in the email. Upon a user clicking the link, SendGrid will record the click and redirect to your original URL.
Alternatively you could create your own redirect URL. The most secure method would be to have a table to store the URLs and generate a unique token such that you could put your own link in the emails along with the token. When your script is hit, pull the target URL from the table that matches the token and redirect to it.
This question already has answers here:
How to protect html form from spammers?
(10 answers)
Closed 7 years ago.
I have a form, and I need to send information from it with SMS. Though I need to protect myself from people that will intentionally send lots of these SMS (that are not free, obviously).
What should I use? Cookies, sessions, blocking buttons with JS, what else?
I also use SMS for various services in my application.
Here is a suggestion that you can try:
Store all the data in Database that has been sent in the SMS, such as Sender user id, Phone no. and message along with a time stamp.
Now that you have data, you can put limit on how many SMS should be sent per day/hour by reading the details of that specific user from the database.
This question already has answers here:
How to check if an email address exists without sending an email?
(15 answers)
Closed 7 years ago.
Up until Facebook closed it's doors on 'Public Post Search' I used to run a site that allowed for this function. Right now am building a new site and have a landing page that allows for the visitor (old or new) to sign up to be notified when the new site is up and running. This is done via email. Unfortunately I have suffered some people inputting non email addresses so solved that with a PHP function, however more recently I've started suffering from what are clearly not valid email addresses like 'foo#bar.com' etc...
Is there a recommended PHP function to check whether the email address is fully valid? If not, is there a free service which has an API that I could use to check whether the address is valid?
The only reliable way to know if an email address is valid is to attempt to send an email to that address and check for a hard or soft bounce.
You can validate that the format of the email address satisfies format checks and therefore could be valid. foo#bar.com would pass that check.
In the ancient days of the internet (the 90's), many SMTP servers would allow one to query "is this email address valid" without going through with sending an email. That was abused by spammers to validate spam lists, so pretty much every SMTP server has that part of the protocol disabled.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to check if an email address exists without sending an email?
Possible duplicate:
How to check if an email exists without sending an email?
I have a very big database with users (over 50000) and there are lots of automated e-mails the site sends out.
The problem is, quite a few of the addresses in the database (that users registered with years ago) have expired or have been deleted or no longer exist for whatever reason.
This creates an issue, because each user should have a valid e-mail.
I've been trying to find out if there's a way to detect whether an e-mail address is active, so we could update the database and prompt those users to enter a new e-mail? Something like a ping for e-mail addresses?
There's some code here that I've tried to figure out but to no avail:
http://www.webdigi.co.uk/blog/2009/how-to-check-if-an-email-address-exists-without-sending-an-email/smtpvalidateclassphp/
Does anyone have a solution?
Please note that I need a PHP solution, not command line since I have 50k e-mails to check.
Two things, first you should stop the influx of potentially in-valid email addresses by implementing a 'closed-loop' email verification system. Basically, when a user signs up for your site, you send an email with a link confirming their email address, and when they confirm, their account gets full access to your site.
Secondly, there is no real way to determine if an an email address is invalid strictly using PHP. I had to tackle this problem a few months ago, and we ended up using the mail-server to tell us if an email address has been bounced back or not. When your mail server sends an email, and the email cannot be delivered, the recipient mail-server will respond with a bounce notification to your mail-server which includes information as to why the email was bounced. Information such as a Delivery Status Notification (DSN) code which identifies why the email address couldn't be delivered.
Some example codes:
511: Bad Mailbox
512: Bad System
516: Mailbox Moved
These codes are made up of a prefix (4 or 5) to indicate a transient (temporary) or permanent failure. The following two digit code indicates an error range; two digit codes between 10 and 19 indicate an error relating to the email address, whereas codes between 20 and 29 indicate an error relating to the email mailbox.
From these codes you can determine, based on business requirements, a 'hard bounce' or a 'soft bounce'. A hard bounce would be something like 511 (bad mailbox), where it's certain that this email address is not currently valid. A soft bounce would be something like 445 (network congested), which indicates that it was a temporary issue as to why the email could not be delivered.
So in your instance, you could send out an email blast, and then track the bounces on your mail server. By looking at each bounce and the respective DSN code, you can flag whether an account's email is valid or not (we used PHP to gain access to the mail server and parse the bounce notifications for the DSN codes)
Here is more information on DSN codes.
-- Edit --
As Dagon wisely mentioned, you can pipe bounced emails into a PHP script upon their receipt. To do this you will need to read up on your mailserver config, but ours looks similar to the following:
bouncehandler unix - n n - - pipe
user=nobody argv=/usr/bin/php /path/to/BounceHandler.php
<% end %>
The only way to check if an e-mail address is expired or not is to send an e-mail message to it and see if you get a response. But note that doing so may be considered spamming, since it is an unsolicited message.
You can check if an e-mail address if properly formed, and if the mail server it specifies actually exists, but thats about it. There is no way that I know of to check if the account exists (and if a human is reading the mail sent there) without sending a mail with a link and requesting that the user click the link.
This question already has answers here:
Closed 11 years ago.
Possible Duplicates:
Is there a way to determine whether an e-mail reaches its destination?
PHP: Check who had read sent email?
I need a php or zend framework code which return a acknowledgment when I send a mail.
If user receives a mail, or not, or may be email is not correct, or when user open this mail; in all these cases I to get a acknowledgement.
How do I do this?
The only way you can know if a user opened a mail to listen for resources (images) that will download to the client (if they allow downloads) otherwise you are in the dark.
Checking the mail was sent and if the address is valid can be done but only to a certain extend the server that sends the message will report if the message could be sent but that will only be the status of the sent message on that specific server. You could setup some kind of mechanism that listens for addresses that are reported by other servers as invalid but not all the servers do this ...
You could use a third-party provider to handle the acknoweldgements for you which will lift the burden from you. Like Mailchimp but they too have limited ways to do this.
Just my 2 cents
If you want to detect the mail being opened, you will need to embed an image in the e-mail. This image is generated by a PHP url like <img src="domain.com/index.php/generate_image/123"> where 123 is the User ID you put in the e-mail so you can track which user opened that e-mail.