I m using Laravel 5.1 and for sending emails I use:
Mail::queue(XYZ, compact(ABC), function($message) use ($mailTo)
{
$message->from(XXX, XXX);
$message->to(XXX)->subject(XXX);
});
In the services.php I have:
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],
and everything works as expected.
However I had to change my Mailgun domain from sandboxXXXXXXXXXXXXX.mailgun.org to my.domain.com
and email are not delivered using the new domain unless I use Mail::send instead of Mail::queue.
I also ran php artisan queue:restart, php artisan cache:clear and finally I restarted the supervisor on my server but it didn't work.
In my log file I can see that using Mail::queue, Guzzle is still using the old domain while contacting Mailgun even if there is not any trace of the old domain in the code anymore.
Any suggestion?!
How can I fix this issue and be able to queue my emails using the new domain?
Thanks for your help!
Related
I am trying to send mails via smtp on my website, ( Symfony 5.2 ), but every time I try to use the built-in mailer bundle, I get the error :
Expected response code "250" but got code "530", with message "530 5.7.1 Authentication required".
I've tried sending mails using a php script, with the same smtp configuration, and it works everytime.
In my .env file :
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=MY_USER_NAME&password=MY_PASSWORD
Any idea ?
Thanks !
According to this https://symfony.com/doc/current/mailer.html#transport-setup, the mailer dsn format should be.
MAILER_DSN=smtp://user:pass#smtp.example.com:port
And not
MAILER_DSN=smtp://mail.infomaniak.com:587?encryption=tls&auth_mode=login&username=user&password=pass
Notice how the user and password are specified. Might also worth mentioning that you might need to URL encode your password should it contain characters that need such an encoding.
Have you tried the format from the docs?
We've been running a new system in test for a while now and creating emails to a folder so they don't accidentally go out to clients. Now we've turned on live emailing we are getting issues with sending.
I'm using ActionMailer.NET and the code to create and send the email is below. I won't include the View:
EmailResult x = new EmailController().EmailWorkOrderForApprovalToClient(model);
System.Net.Mail.Attachment file = new System.Net.Mail.Attachment(FilePath);
x.Mail.Attachments.Add(file);
x.Deliver();
Which gives the error
The SMTP server requires a secure connection or the client was not
authenticated. The server response was: 5.7.57 SMTP; Client was not
authenticated to send anonymous mail during MAIL FROM
The web.config looks like this:
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="ClientServices#topupconsultants.com">
<specifiedPickupDirectory pickupDirectoryLocation="" />
<network defaultCredentials="false" host="smtp.office365.com" password="secret" port="587" userName="ClientServices#myco.com" />
</smtp>
</mailSettings>
My assumption is that enableSsl="true" needs to be added to the network line, but when I do that and try to go to the SMTP Email section of the site in IIS, I get the error:
Unrecognized attribute 'enableSsl'
I'm not that hot on IIS, but I've checked that the Application Pool and its .NET CLR version is 4.0.30319. I've also checked that .NET v4.5 is installed on the server.
This is baffling me, and I'm hoping I don't have to totally change my code to a method that allows me to specify SSL at that point.
Answering my own question here, and basically the answer is: "Don't believe the error message". In all the configurations I tried, I believed the error message when it told me that is was unacceptable. However, I tried it anyway, and it uses the enableSsl attribute when it sends, and this allows the connection to Office 365 to succeed.
Slightly irritating IIS bug that I'll forget about in a week, but right now is very annoying.
This is issue on IIS no need to worry about this error message
SmtpClient object enableSsl value get mapped
this silly issue is wasted my much time :D
i am currently developing a website which requires email verification, but i am developing on windows, and would like to test sending email verifications on localhost. I tried using Test Mail Server Tool, but i don't think i am setting it up correctly because there were no errors, but i didn't receive any email. this is the code i put in my config file
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['mailpath'] = 'C:\Program Files\Toolheap\Test Mail Server Tool\TestMailServerTool.exe';
$config['protocol']= 'smtp';
what am i doing wrong? i am really new to this so i have no idea where to start looking.
i created an email.php and put that in application/config/ so i don't think i need to initialize it?
thanks in advance.
Have you checked whether or not you need to include the following configuration options?
smtp_host
smtp_user
smtp_pass
smtp_port
I am signed up for AWS SES (with instance, S3 and my website running nicely). I also have rec'd approval for sending out email without receiver verification and "mass production" OK. The only thing I'm left with is having my 3 "from" email addresses verified. Started to download Perl, as was suggested to run email-verification scripts -- but got no where with the installation. Do have my credentials ready to use.
There is an AWS SES API to use for verification which I can't find... suspect that it has something to do with AWS's sdk which I could figure out how to install.
So my question: is there a simple, straight forward way to get my email addresses to Amazon for verification via a response email they send? Their documentation is somewhat confusing.
You have to go validate your email address through their web service (like the perl script is doing). You can also use their SDK's that they publish, which are wrappers around their web service. For example, if you have Visual Studio, you can use the AWS SDK for .NET (also available as a Nuget package: PM> Install-Package AWSSDKForNET) and set up a simple console application to do something like this:
using Amazon.SimpleEmail;
using Amazon.SimpleEmail.Model;
static class Program {
static void Main() {
var client = new AmazonSimpleEmailServiceClient("yourAccessKey", "yourSecretKey");
var request = new VerifyEmailAddressRequest { EmailAddress = "yourEmailAddress" };
client.VerifyEmailAddress(request);
}
}
They also have SDK's available in PHP and Java that work pretty much the same.
This is an old post but came up in a search.
You can now verify emails directly from the SES control panel (See screen shot)
AWS SES Panel
I'm implementing OpenID support for a public website. Yahoo and Verisign openid authentication currently works fine. However, I cannot seem to connect to Google's endpoint.
Below is the code:
Usual initialization and stuff...
my $csr = Net::OpenID::Consumer->new(
ua => LWP::UserAgent->new(),
consumer_secret => time,
args => CGI->new(),
debug => 1,
);
my $claimed_identity =
$csr->claimed_identity('https://www.google.com/accounts/o8/id');
my $check_url = $claimed_identity->check_url(
return_to => "http://bla.com/openid",
trust_root => "http://bla.com",
delayed_return => 1,
);
print $check_url, "\n";
... other stuff
The error is always the same:
url_fetch_error: Error fetching URL: Not Found
A. There are two mysteries here. I can use LWP directly and grab the XRDS file from https://www.google.com/accounts/o8/id wih no issues.
B. Using same code, but changing the endpoint discovery url to "https://me.yahoo.com" works perfectly fine.
How do I make my code work with Google? I'm quite baffked why I doesn't work for Google when it works for Yahoo and Verisign. Any ideas?
Solved. There's nothing wrong with the code. The machine I deployed to was a Debian Lenny. The installed version of Net::OpenID::Consumer was really old : version 0.14. I upgraded it to the latest version (1.03) via CPAN. The code now handles Google, Yahoo and Verisign OpenID endpoints and authentication flawlessly. Going to add Live Mail (Hotmail) soon. ;-)