my application use piwik for statistics. when I config the mail section. something wrong happen. the config is like this:
[mail]
transport = "smtp"
port = "587"
host = "smtp.qq.com"
type = "Login"
username = "username#qq.com"
password = "*********"
encryption = "tls"
and when transfer a mail the error information is like this:
An error occurred while sending 'PDF Email Report -
1.2016-11-15.2.zh-cn.pdf' to *******#qq.com. Error was 'mail from address must be same as authorization user'
and I google with this info , but nothing I found work fine.
I guess there was somewhere I can put the address from as I do before. But I don't find the place.
Could someone tell something about this question, thanks a lot.
I have handle this question. The solution is add a line in config/config.ini.php [General] code section.
noreply_email_address = username#qq.com
I don't know how it work. but obviously, it work.
Hope this solution can help someone !
Related
Im rewriting a few scripts to make use of the new v4 signature for Amazon AWS.
I am trying to send an email using the code on this page:
https://github.com/okamos/php-ses
When I use his code exactly as it is just adding secret keys etc I get an error saying my email address isnt verified on us_east_1. This makes sense as all my things are on EU_WEST_1.
So Ive tried adding the EU endpoint as a third parameter but get this error:
'Warning: SimpleEmailService::sendEmail(): 6 Could not resolve host: EU_WEST_1'
This is the line of code which seems to work but connecting to the wrong endpoint
$ses = new SimpleEmailService('apikey', 'secretkey');
print_r($ses->sendEmail($m));
I have tried adding the new endpoint as the third parameter like this
$ses = new SimpleEmailService('apikey', 'secret','eu-west-1');
But that just generates the error.
Can anyone tell me the correct code to use to set the eu-west-1 endpoint to send emails through?
Thanks
I had faced the same problem with AWS PHP library for uploading files to S3. Even though I was setting up the region from us-east-1 to eu-west-1 it was still taking us-east-1 as by default. I would suggest you to look for region configurations in library and how it is overriding.
SES Email Host for us-east-1 and eu-west-1 are different. So even though if you are passing correct API and Secret, it might not work because of default region.
If this debug process doesn't work can share the screenshot of what you region you are getting before email dispatch. I would love to explore further.
I found the problem.
Looks like there was a typo within the code on github, it had these 3 lines in the file 'SimpleEmailServices.php:
const AWS_US_EAST_1 = 'email.us-east-1.amazonaws.com';
const AWS_US_WEST_2 = 'email.us-west-2.amazonaws.com';
const AWS_EU_WEST1 = 'email.eu-west-1.amazonaws.com';
He'd missed the underscore in the AWS_EU_WEST1.
I am using zend framework to send emails. I have an Hostname::ALLOW_DNS validator. It fails when trying to send email to yahoo.gr. I get this error:
An error occurred
An error occurred during execution; please try again later.
Additional information:
Zend\Mail\Exception\InvalidArgumentException
File:
/var/www/file/project/vendor/zendframework/zendframework/library/Zend/Mail/Address.php:41
Message:
'yahoo.gr ' is not a valid hostname for the email address
The email is smth#yahoo.gr. Any suggestions?
From your error, the only problem I can see is the whitespace 'yahoo.gr ' which will/can cause failure of validation.
Fix Suggestion 1:
You should start using trim() on your GET/POST "email" value.
Fix Suggestion 2:
Which is by the way in the documentation:
Validating only the local part
If you need Zend\Validator\EmailAddress to check only the local part of an email address, and want to disable validation of the hostname, you can set the domain option to FALSE. This forces Zend\Validator\EmailAddress not to validate the hostname part of the email address.
$validator = new Zend\Validator\EmailAddress();
$validator->setOptions(array('domain' => FALSE));
Fix Suggestion 3:
Which is by the way in the documentation as well:
Validating different types of hostnames
The hostname part of an email address is validated against Zend\Validator\Hostname. By default only DNS hostnames of the form domain.com are accepted, though if you wish you can accept IP addresses and Local hostnames too.
To do this you need to instantiate Zend\Validator\EmailAddress passing a parameter to indicate the type of hostnames you want to accept. More details are included in Zend\Validator\Hostname, though an example of how to accept both DNS and Local hostnames appears below:
$validator = new Zend\Validator\EmailAddress(
Zend\Validator\Hostname::ALLOW_DNS |
Zend\Validator\Hostname::ALLOW_LOCAL);
if ($validator->isValid($email)) {
// email appears to be valid
} else {
// email is invalid; print the reasons
foreach ($validator->getMessages() as $message) {
echo "$message\n";
}
}
Well, no more suggestions. I wish you good luck!
The End.
So I have created a custom form page that accepts applications from potential employees.
It worked fine before I added an ssl certificate but now is not sending any of the data along with the email.
It will send the Template email but not the data but I know that the data is making it to the controller.php as the sender in the Email is correct.
I bring the info into the controller as follows.
if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
if (isset($this->error['fullname'])) {
$data['error_fullname'] = $this->error['fullname'];
} else {
$data['error_fullname'] = '';
}
Then send the data to my employment template where I believe the issue is
$html = $this->load->view('default/template/mail/employment.tpl',$data);
// This right here no Longer works after adding SSL
Then send the mail after attaching the HTML
$mail->setSender(html_entity_decode($this->request->post['fullname'], ENT_QUOTES, 'UTF-8'));
$mail->setHtml($html);
$mail->send();
This is located out side of the POST if statement to makesure the action on the form is using SQL
$data['action'] = $this->url->link('information/Employment', '', 'SSL');
Then in employment.tpl my email Template I will reference fullname
<?php echo $fullname ?>
I always receive the email but it is only the template never any of the data. I have tried using the full link with https:// on the $this->load->view but that does not work either.
Any help at all is greatly appreciated and will be glad to provide any additional information if needed.
Kindly check the ssh setting is working fine or not on your site.
system -> settings -> store edit and then check SSH setting.
it is just issue of the http => https or https => http
Please communicate on skype if not resolved.
skype: jks0586
I am trying to learn how to send emails using Mailgun in Laravel. When I try to send the email I get a timeout that says: Maximum execution time of 60 seconds exceeded
The application times out here:
$line = fgets($this->_out);
I have a route that activates when I click a button on my email page:
Route::post('/email', 'MainController#sendEmail');
Here is my controller function (replaced my email for privacy reasons):
public function sendEmail() {
$data = [
'title'=>'Email'
];
Mail::send('emails.hello', $data, function($message) {
$message->from('example#gmail.com', 'Example Person');
$message->to('example#gmail.com')->subject('we made it');
});
return Redirect::to('/');
}
Any ideas on what I may do be doing wrong?
This generally happens if the SMTP port used in the app/config/mail.php config file is not opened by your hosting provider. Please check and ask them to open the port. This should resolve the issue.
Sending emails through mailgun could not be simpler, just add the API package, publish and update the config and use the custom facade to send them (changing Mail::send() to Mailgun::send())
You can find the package here: http://packalyst.com/packages/package/vtalbot/mailgun
I know this doesn't really address the error your getting (would need more information to help with that), but using the package does simplify the whole thing!
I need to read emails from gmail but i cant connect to gmail pop3 server.
Can anyone help me here ?
Here the code:
$pop3 = new POP3;
$pop3->server = 'pop.gmail.com';
$pop3->user = 'username';
$pop3->passwd = 'password';
$pop3->debug = true;
$pop3->pop3_connect()
The result:
Warning: fsockopen() [function.fsockopen]: unable to connect to pop.gmail.com:110 (Connection timed out) in /public_html/cron/pop3.php on line 64
Thanks
According to this page (connecting to Gmail using Outlook Express), you have to use port 995 for POP3 access to Gmail, and furthermore, SSL must be enabled.
Wikipedia also states this:
E-mail clients can encrypt POP3 traffic using Transport Layer Security (TLS) or Secure Sockets Layer (SSL). A TLS/SSL connection is negotiated using the STLS command. Some clients and servers, like Google Gmail, instead use the deprecated alternate-port method, which uses TCP port 995 (POP3S).
I'm not sure if it will help you, but GMAIL has an ATOM feed. I wrote a PHP script to download the Atom Feed, using CURL, so that I could check my email on my antiquated cell phone that only supported very simple HTML. So, depending on what you want to do, it might be easier to download and process the ATOM feed than it is to connect to the POP server.
I don't know what class you're using -- but for instance, using Daniel Lemos' package is shown below. The key is choosing the right port (995), and the right encryption method (TLS set to true for whatever pop3 package you are using). For example, you could use something like the below to initiate the connection. Not a big fan of how this class is architected, or the sample code (lot of nested if statements), but it does the job.
$pop3=new pop3_class();
$apop=0;
$pop3->authentication_mechanism="USER";
$pop3->debug=0;
$pop3->html_debug=1;
$pop3->join_continuation_header_lines=1;
$pop3->hostname = "pop.gmail.com";
$pop3->port = 995; // The port that gmail uses...
$pop3->tls = 1; // This is encryption
$user = "someuser";
$password = "some password";
if( !empty($error=$pop3->Open()) ){
die( "Something terrible happened..." );
}
$pop3->Login($user,$password,$apop);
I think there are two easy options to your email:
Cron atom feed like Kibbee says. But then you will have a little delay between when message was sent and when you fetch it.
Use http://smtp2web.com/ which will post your email to your website which means a lot shorter delay. Offcourse privacy should not be crucial, because your mail will pass through intermediate.