I've already confirmed my custom domain and I'm always get this error:
554 Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.
The following SMTP error was encountered: 554 Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Config:
$this->email->initialize(array(
'mailtype' => 'html',
'protocol' => 'smtp',
'smtp_timeout' => 30,
'smtp_host' => 'ssl://smtp.mailgun.org',
'smtp_port' => '465',
'smtp_user' => '***',
'smtp_pass' => '***'
));
What could be wrong? Try in both localhost / server - and the same error is shown. This is not credentials problem either cause I can see the logs on Mailgun dashboard.
Pretty sure that they changed their policy recently: "Without a credit card you are restricted to authorized recipients only."
You just need add CC to make it work. - They should put this message on the top of their registration page!!!
It's still free for first 10,000 though.
A bit annoying - but the solution is to add credit card to the account.
credit card need not be added. the error message clearly shows that no authorized recipients have been added. Mailgun allows 10,000 free emails for 30days, which can be used for testing (even from a local host) provided authorized email ids are added (upto 5). this can be done on the dashboard page. instructions given in the documentation. I have been testing out my mailer using a localhost (WAMP server) on 3 authorized email recipients that i've added. credit card is to be added only when the 10000 email quota is exceeded.
Related
[UserFrosting 0.3.x]
I just set up UserFrosting, and everything looks to be working, except one tiny thing...
When a user goes to register, there's an error "Fatal error attempting mail, contact your server administrator"
In the config-userfrosting.php, the smtp section is filled out as:
'mail' => 'smtp',
'smtp' => [
'host' => 'smtp.scottywcreates.com',
'port' => 465,
'auth' => true,
'secure' => 'ssl',
'user' => 'userfrosting#scottywcreates.com',
'pass' => '------'
],
(password blacked out)
Why am I getting this error?
The message that the user sees is just a generic error message, indicating that there was some problem with the mail server. It purposefully avoids giving specific details, that you may not want to disclose to the general public.
To find out the specific error condition, you will need to check your PHP error log. Please check with your particular server configuration to find the location of the PHP error log.
UserFrosting uses PHPMailer to send mail. By default, PHPMailer doesn't output any detailed SMTP error information, so you will likely see a generic exception message in the error log as well (for example, "SMTP Error: Could not authenticate.")
To obtain more detailed error information, you can hack userfrosting/models/Notify/Notification.php and change PHPMailer's default settings. Add the following configuration values to the other SMTP configuration values:
$mail->Debugoutput = 'error_log';
$mail->SMTPDebug = 4;
This will tell PHPMailer to dump very detailed connection and error information to the PHP error log. Once you do this, you should be able to see why exactly your SMTP server is rejecting UserFrosting's emails.
Common reasons that SMTP fails:
Many SMTP servers require that the authenticated account (in your case, userfrosting#scottywcreates.com) matches the From address in the actual email. By default, account verification emails are sent from the "Account Management Email" address set under Configuration -> Site Settings. So, you might try checking that it matches the address you use to authenticate in config-userfrosting.php.
Using the wrong port or authentication method. See the Email Troubleshooting wiki.
I'm trying to send an email using PHP Pear. It works when I send email using Gmail with this settings:
$smtp = Mail::factory('smtp', array(
'host' => 'ssl://smtp.gmail.com',
'port' => '465',
'auth' => true,
'username' => 'username#gmail.com',
'password' => 'password!2016'
));
But before I make this work, I have to "allow less secure apps" to access my account, which you can read here on how to do it.
I tried to use an Outlook account with this settings:
$smtp = Mail::factory('smtp', array(
'host' => 'tls://smtp.office365.com',
'port' => '587',
'auth' => true,
'username' => 'email#domain.org',
'password' => 'greatPasswordComesWithGreatResponsibilities'
));
but I get this error:
Failed to connect to ssl://smtp.office365.com:587 [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) (code: -1, response: )]
I checked the official article by Microsoft regarding their SMTP settings. So I thought I have the right settings, but it's not working.
Am I missing something? Why do I get this error? Is there a setting I have to configure in my outlook account, like with the Gmail, before a third party app be allowed to send email?
This may not help but the title of your post just said Outlook account but the link and smtp settings refer to Office365 for Business accounts. I can't shed any light on the business account but if you actually have a personal Outlook.com account the settings are different. And, there is an option on the account you must change to enable pop/smtp access as you did with gmail.
The official Microsoft article is:
https://support.office.com/en-us/article/Add-your-Outlook-com-account-to-another-mail-app-73f3b178-0009-41ae-aab1-87b80fa94970?ui=en-US&rs=en-US&ad=US&fromAR=1
But, the summary is the smtp server is smtp-mail.outlook.com and to enable pop/smtp in your Outlook account look for Options > Managing your account > Connect devices and apps with POP.
Update:
If you are actually using business account, you should check this post which claims to have it working: https://stackoverflow.com/a/26004690/2891120
The key item in his code is he doesn't have "tls://" in front of the host name. I have a consumer outlook account and get a similar socket failure to you with tls:// prefix. If I remove that prefix I get much farther (set debug=true in factory) but fail later with an auth failure. Using 5.2.16 PHPMailer instead I successfully send mail but the headers leave me worried about spam rejection rates (no DKIM, SPF was softfail for my AWS entity, warning about -f, and others). And, the email did end up in the junk folder of my other test recipient #outlook.com. But I digress.
Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp
function index() {
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'gauravkwt#gmail.com',
'smtp_pass' => '92135108845129',
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('gauravkwt#gmail.com', 'Gaurav kwatra');
$this->email->to('gaurav.kawatra#ymail.com');
$this->email->subject('This is an email test');
$this->email->message('Emial Testing');
//$this->email->initialize($config);
if($this->email->send())
{
echo 'Your email sent...!!!! ';
}
else
{
show_error($this->email->print_debugger());
}
}
//end of code
I use above code to send mail from codeigniter....I have an error...Failed to authenticate. Password is correct.
You would need to go to your account settings https://www.google.com/settings/security and you would need to enable Access for less secure apps which helps to use the google smtp for clients.
Please have a look here too
If it still doesn't work even after enabling less secure apps - you should login to your security area within your Google account and see if your device has been blocked. Google blocked my server so I then went to https://accounts.google.com/b/0/displayunlockcaptcha and it now allows me to send. Nothing to do with the username or password but Google blocking the device access.
I have got the same problem and the solution I found by unblocking the google captcha. Google blocked my server IP sending email using their SMTP. So I had to unblock it.
To unblock the google captche:
Open the link https://accounts.google.com/DisplayUnlockCaptcha.
Enter your username and password to sign in to your gmail account that you have used for the SMTP configuration.
You will get the button on google like the image bellow.
Then you need to allow access to your google account by clicking the continue button.
Note: You might get blocked again and anytime if you make some spam and your receiver email addresses are not exist.
So if anyone knows how to make it unblock permanently without by any google setting or something, it would be really appreciated.
One of the reason can be the cpanel settings. Please try:
Login to CPanel
Tweak Settings > All>
"Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)
And select "off"
Although it was a question five years ago, today I encountered the same situation and found the correct answer as a supplement.
All CI settings are correct, the only problem lies in Google ’s security settings, go to
https://myaccount.google.com/security
And set Sign in using App Passwords, which can find options, select mail, and choose other in the options of the device, enter the name at will, such as PHP / CI, and then Google will generate a password for you to use.
Please replace the password you entered in the CI email with this password, cheers.
I've a laravel app nad I've been testing it with gmail smtp server and It was working in my system's localhost but then I deployed it on server (blue host) and change the configuration and still the app thinks that is sending emails and it's not giving me errors but no email is delivered to corresponding email addresses....
Here's my mail.php in app folder:
return array(
'driver' => 'smtp',
'host' => 'mail.mash-up.fi',
'port' => 26,
'from' => array('address' => 'registration#mash-up.fi', 'name' => 'Admin'),
'encryption' => 'tls',
'username' => '************',
'password' => '******',
'sendmail' => '/usr/bin/sendmail -bs',
'pretend' => false,
);
where I'm doing wrong?
any help is appreciated
If you are using the BH DNS(ns1.bluehost...), then check to see that the $from address is an existing email in your BH account.
(go to your CP /domain manager and use whois info to find that out.)
or.....
maybe, you migrated the source code, but did you transfer your domain name to BH, or is it pointing to BH servers (DNS)
In that case your site is not using the BH mail servers.
example :your site content could be on BH, but if it is registered somewhere else and the DNS is not ns1.bluehost.com..etc, then your domain might be using url forwarding or framing (to bring visitors to the BH location). but your mail functions may be handled by the registrar's
hope this is not too confusing
it is also helpfull if you post your domain name here and others can help figure out as well.
Please try to check the spam folder of where your sending to. If there is nothing, make sure your "from" is truly your bluehost email account your using to send the email. If the actual sender doesn't match the "from" of the e-mail many mail clients will ignore it entirely (like hotmail), but gmail will put it in the spam folder with a warning.
The host should be your bluehost box I think. In fact on cpanel, go to email, where you create accounts. Then click on "More", select "Configure Email Client", scroll down. You will see the host name, and port.
TTL/SSL would likely need port 465, I am guessing (I use the latter, not the former like you).
Open up the laravel.logs file inside of storage > logs. It should help give you some idea of what the problem might be.
On my localhost (Linux Mint OS) Swiftmailer is working fine with the following code, but whenever I move it up to my server is just hangs at the send function and then gives me an internal server error.
I currently have my email setup through Google Apps, so maybe SMTP will not work for this situation? If thats the case, how do you suggest I change this from SMTP.
Also, whenever I send an email like this, it is showing up with a from address of the one in the username area. I want it to show up with the from address in the "setFrom" function.
//Include the swiftmailer class
require_once 'comm/swiftmailer/swift_required.php';
//Create a message
//Pass it as a parameter when you create the message
$message = Swift_Message::newInstance();
$message->setSubject('My Subject');
$message->setFrom(array('noreply#domain.com' => 'No Reply'));
$message->setTo(array('me#domain.com' => 'Me'));
$message->setBody($emailContent, 'text/html');
//Create transport class and email the message
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')->setUsername('useracctname')->setPassword('password');
$mailer = Swift_Mailer::newInstance($transport);
$result = $mailer->send($message);
Thanks a lot for any help!
This might be a port problem on the server. Port 465 could be closed to prevent spamming. It could also be that the server's version of PHP lacks SSL support.
I am wondering though, could it be that I am not using the local mail server so it wont allow SMTP?
If you address gmail as explicitly as you do, it's very unlikely you're using another transport type or a different server.
Also, what about using one of the other transport types?
I think SMTP is your only option to get it running with Gmail. It could, however, be that your server is providing a mail() based service (obviously with a different sender address than GMail though). In that case, you may be able to use Swiftmailer's mail transport.
I had the same problem : I was able to send gmail email in local (after updating that configuration : https://www.google.com/settings/security/lesssecureapps ) but not in production.
To fix my problem I've logged to my gmail account with my production ip / from my production server and answer the gmail security question.
One of the solution to log to your gmail account with your production ip, is to
open an ssh tunnel (ssh -2NfCT -D 5000 yoursshuser#yourdomain.org)
configure you browser to use that proxy (eg Firefox :to Preferences > Advanced > Network > Settings > Manual proxy configuration > SOCKS Hosts: localhost / Post: 5000 / SOCKS v5 )
log to you gmail account as usual
The error outputed by Symfony was :
app.ERROR: Exception occurred while flushing email queue: Failed to authenticate on SMTP server with username "joe.doe" using 1 possible authenticators [] []
well, here is the solution.
if you are sending SMTP mail you should create email account at the server then use this email info at your code.
the server will not send the email if you don't have valid email account to send using it
when you use "from".
this should be a true correct email account a fake one.
the only possible reason to send using fake account is using mail() function.