Testing Sparkpost SMTP RELAY - php

Ok I am using Yii2 mailer, but I need to test access to sparkpost smtp on regular bases. So I made an action that sends a email to Sparkpost when I call it.
Now Is there a way to tell Sparkpost that this email is just a test so it will not send the email? I need this so I would not send hundreds of mails a day to sparkpost just for testing purposes.
NOTE: I am using simple SMTP Relay.

The best way to not have an email actually get delivered from SparkPost is to append ".sink.sparkpostmail.com" to the end of the email address. For instance, if your email address is "alice#example.com" then use "alice#example.com.sink.sparkpostmail.com"
You can find more details about that here:
https://www.sparkpost.com/docs/faq/using-sink-server/

Related

Can we do email tracking when sending email via smtp using php zend framework

Currently I'm using mailgun to send email, but planing to send email using smtp in zend framework php.
My main concern are:
Need to track the emails against open and click by recipients.
how can we send the emails in batch like for marketing emails or bulk emails?
is there any limit like only x numbers of emails can be sent using one Smtp authenticated configuration?
do we need to have user based SMTP settings to send email from those users or is it possible to have one common SMTP settings base same email domain for all the users to sent email from our application?
Mailgun have functionality for track your messages, more information you can find here. If you want to have your own mail server for sending your emails I don't have idea how to track messages unfortunately
I think best way to send bulk email messages is queue implementation. You can implement own queue or use something ready. Mails should be send by cron job to avoid blocking main connecting thread
Yes, mailgun has limits: Mailgun Pricing Page but if you wan't to send mails by your own server there are no limits.
You can have one account to send emails, it's not a problem

Read Email from Gmail inbox as it arrives

I've a drupal 7 site, and requires a functionality by which I can read emails from gmail inbox whenever they arrives. Currently I'm achieving it with php imap by running it on cron.
But I want something, which can read email from inbox as soon as it arrives.
Please suggest, thanks
This would be a bit of a round-the-houses approach but create an account with mailgun.com. Within Mailgun you can then direct incoming emails to a URL you specify. Mailgun parses the email and sends it to you in a structured format.
You could then set up your Gmail account to send a copy of all incoming emails to your Mailgun account.

handling bounce email w/phpmailer

I have a webpage that sends out emails using phpmailer. I set the host to 'relay-hosting.secureserver.net' the mail->sender, mail->from and mail->addReplyTo all to the same address, which is the address that I want the bounced email notifications sent to. This email address in also with the same host and the smtp host. When I put in a bad email address I don't get a notification that is was not delivered. What am I doing wrong? Thanks
PHPmailer does not handle receiving emails. It's purely a library for allowing PHP to talk to an SMTP server for sending emails. It has absolutely no support whatsoever to act as a mail client (e.g. receiving).
PHPmailer has no way of knowing the email bounced, as the bounce occurs LONG after PHPmailer's handed the email off to the outgoing SMTP server. IN real world terms, PHPmailer takes your letter and walks down the block to drop it into a mailbox. The bounce occurs later, when the letter carrier brings the letter back with 'return to sender' stamped on it - PHPmailer is not involved in this at all.
Your options are:
1) Use PHP's imap functions to connect to an existing pop/imap server and retrieve emails that way
2) Use a .forward or similar redirect on the SMTP side to "send" incoming email to a PHP script.
I know this is an old and answered question, but for those who may find this post later with a similar problem you might be able to solve this by going to your smtp mail relay service. If for example you use jangosmtp there is an option in your jangosmtp control panel to either hard code the address to which bounce reports should be sent or to always send bounce reports to the From address.

PHP Mailer Class

I use the PHP Mailer Class along with the SMTP extension to send e-mail.
The problem is that the php script sends emails only to YAHOO or GMAIL addresses but when I try to send to blabla#neobee.net, I never receive the email.
There are no error messaged when I send to blabla#neobee.net.
There are a lot of things to be checked before you can send mail from a server.
Many recipient mail servers need something called as spf record to be set at the sender's domain:
www.openspf.org/Introduction
I think , if you are not sending more than 100 mails a day , a better approach would be to use smtp mailer along with google mail
Send email using the GMail SMTP server from a PHP page
So in that way you need not mess or worry about spf or DKIM ..
Its a simple solution but your email would have something#gmail.com that wouldn't be so professional , so if you are looking for professional solution then you need to look for setting up spf records and DKIM for your domain

how to send email from php mail function using gmail account?

I have to send email from my gmail account using php mail() function. I have read the phpmailer but I don't want to include any external apis. Please suggest.
Thanks in advance.
You cannot use mail() to send email with your Gmail account, you'll have to use something that talks to Gmail SMTP server directly. So you're stuck with writing your own or using one of the availiable libraries, the most commonly known are:
Swift Mailer
PHP Mailer
Zend Mail
Assuming mail() works on your server, just:
<?PHP
mail($to,$subj,$body,"From: yourname#gmail.com\r\n");
should do it.
The reason this works is that the "From" address on an email is really very much like the return address on a snail-mail envelope. I can write a letter and mail it from my home, with a return address for my office.

Categories