LolipopでLaravelを使う時のメール送信用ドライバの設定
Lolipop等の共用サーバーでは、sendmailコマンドに独自のラッパーが使用されていることがあります。そして、地味に挙動が違ったりします。
Laravelのメール送信機能(SwiftMailer)の設定もまた、Lolipopの共用サーバーではそのままの設定では動きません。
そんなときはこうします。

seen from Australia
seen from Bangladesh
seen from United States
seen from United States
seen from China
seen from United States

seen from United States

seen from United States
seen from Chile
seen from Japan
seen from Libya
seen from United States
seen from Libya
seen from United States
seen from Libya

seen from United States
seen from United Kingdom
seen from China

seen from China
seen from Russia
LolipopでLaravelを使う時のメール送信用ドライバの設定
Lolipop等の共用サーバーでは、sendmailコマンドに独自のラッパーが使用されていることがあります。そして、地味に挙動が違ったりします。
Laravelのメール送信機能(SwiftMailer)の設定もまた、Lolipopの共用サーバーではそのままの設定では動きません。
そんなときはこうします。

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
ownCloud versendet keine Emails
Anfrage: Ich habe mir ownCloud auf einem Raspberry Pi installiert und möchte Status Emails über meinen eigenen Mailserver verschicken lassen. Leider klappt das nicht.
Lösung: Vermutlich hast du bei deinem eigenen Mailserver kein vollständig signiertes Zertifikat hinterlegt. Bei einem sogenannten “self-signed certificate” verweigert die Mailkomponenten von ownCloud den Dienst. Das kannst du mit folgenden Anpassungen ändern.
1.) SSH in ownCloud
2.) Folgende Datei zum Schreiben öffnen:
sudo nano /var/www/owncloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php
3.) Die zwei fetten, kursiven Zeilen einfügen (vor die Zeile beginnend mit $this->_stream):
$options['ssl']['verify_peer'] = FALSE; $options['ssl']['verify_peer_name'] = FALSE; $this->_stream = @stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, stream_context_create($options));
Beachte: Nach einem Update muss das Prozedere wiederholt werden.
Delivering emails within long-lasting jobs
I found a little issue with email delivery using SMTP within long-lasting jobs. The problem - SMTP connection is created for first email delivery, and kept open only for certain time. When the job tries to send another email after some time - it fails. Solution - reconnect to smtp server before sending email.
Not sure yet how efficient it is, but it works now.
Here is my trick:
<?php
class .... {
public function __construct(Swift_Mailer $mailer) { $this->mailer = $mailer; }
public function deliver(Swift_Message $message) { // get configured mailer transport $transport = $this->mailer->getTransport(); // connect to smtp server $transport->start(); // send message $result = $this->mailer->send($message); // close connection $transport->stop();
return $result; }
}
Fixing Connection timeout on Swiftmailer
Just today I ran into an issue with Swiftmailer trying to connect to the users new Google Apps SMTP server. When using this code:
Swift_SmtpTransport::newInstance('smtp.gmail.com', 465);
I would get an exception with a message like this one:
Connection to smtp.gmail.com:465 Timed Out
Turns out that Swiftmailer doesn't expect the port 465 to use SSL and you have to manually tell it that the content has to be encrypted. In order to do so you can use this:
Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'sslv3');
Which will tell it to use SSL for the connection and therefore making GMail answer properly. In case you wanna disable encryption completely you could also use this code here:
Swift_SmtpTransport::newInstance('aspmx.l.google.com', 25);
This does ONLY allow you to send email to addresses that either use GMail or Google Apps accounts. So you CAN'T use it for data you wanna send to clients (since they may use Hotmail or Yahoo or something else).
Hope this helps someone.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Send correctly formatted HTML emails with Laravel and Swiftmailer
Lately I've been using Laravel for most of my development. It's a great platform and nicely written but when it comes to sending HTML emails - it's not setup correctly.
For those who don't understand the mechanics of email allow me to clarify. At the head of most email messages is a piece of information called "content-transfer-encoding" which basically states the way the data is formatted. By default Laravel via Swiftmailer encodes HTML emails using "quoted printable" which can wreak havoc on HTML in your email.
Below is an example of a better way to encode HTML email messages using 8bit encoding.
Mail::send("emails.welcome", $input, function($message) use($input) { $message->setEncoder(Swift_Encoding::get8BitEncoding()); $message->to($input['email'],$input['name'])->subject("Verify Your Account"); });
Send an Email with inline CSS rules
SYMFONY2-Bundle Simplifies the work of your frontend team.
Bring CSS Inline
All CSS needs to be inline for HTML emails. For ease of editing, we've kept the CSS separate. When you're ready to send your email, you'll want to use a CSS inliner tool, such as MailChimp's or Premailer, among others. Many email campaign tools such as Campaign Monitor will do this for you automatically.
ZURB, Inc
If your are a Symfony2 developer use the "css inliner bundle"
https://github.com/toretto460/swift-css-inliner-bundle
Symfony2 Swiftmailer does not send mails in Commands.
The Symfony2 Swiftmailer does not send mails that are spooled in 'memory', because of a missing 'kernel.terminate' Event when used in a Command.
More on that: http://sgoettschkes.blogspot.de/2012/09/symfony-21-commands-and-swiftmailer.html
Solutions:
Use 'file' spooling and send mails with 'swiftmailer:spool:send'.
Add some code in the Command to flush spool by hand
$container = $this->getContainer(); $mailer = $container->get('mailer'); $spool = $mailer->getTransport()->getSpool(); $transport = $container->get('swiftmailer.transport.real'); $spool->flushQueue($transport);