I have database of approximately 10k users who have subscribed for newsletters. I am changing my site from asp to php. I am sending newsletters by cron job. I want to track the record of unsuccessful delivery report. How is it possible? Please Guide me, Thanks.
相关问题
- How to add sender name before sender address in py
- Android: Using Intent to send email - only offerin
- Verify if an email address exists or not
- How can I add condition on mail notification larav
- My email signature will not appear when generating
相关文章
- How do I make a forward e-mail link?
- Debug HTML Email in Gmail App
- Sending email using php, gmail, and swiftmailer ca
- Android - getting an error “no application can per
- How can the Return-Path header be different than t
- Regex Email - Ignore leading and trailing spaces?
- Sending mail with ASP.Net vNext
- TFS email notification
This is highly inaccruate for what the OP is actually trying to do... From the manual:
Depending on server type and configuration you will get varying results. Its better to use SMTP to ensure a proper and consistent interface. Generally i would use a library to do this... you could do it yourself manually using sockets, but why reinvent the wheel? There are 3 libraries i use depending on the project...
For this level of interaction i would use SwiftMailer or Zend_Mail. Both of these support getting information from SMTP as well as sending the message, so for example you can get info about failed recipients (SwitftMailer example). Both Zend and Swift also support custom spools queues so you can more deeply integrate queuing and sending messages in an application aware way. SwiftMailer also has batchSend functionality... i assume this is available in Zend_Mail as well but ive never dug in to deep.
This is only half the battle though... In order to actually read the NDR's you need to script logging in to the mail store, looping through the messages, and then parsing the headers and/or the message body of the NDR (make sure you refer to the RFC docs listed on the wikipage), then take action based on that. Recently i used Zend_Mail_Storage to handle this. If you need to do this then you probably also want to just go ahead and use Zend_Mail for sending as well since Storage is included in the component. Youll need to take a look at the RFC for NDR's and status codes in order to parse properly.
Overall, if at all possible, i recommend just integrating a 3rd party service like MailChimp or Constant Contact. Its a a lot less work, and unless you have a team of devs working on this over time a service is probably going to yield better results across the board.
In php when you sending mail with mail function you should check with condition
if(mail($to, $subject, $message, $headers)){ // Successfull mail delivery } else { // Code for un-successfull mailing }