Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laminas Mail Laravel Package

oroinc/laminas-mail

oroinc/laminas-mail is a small bridge package for using Laminas Mail components within Oro applications. Provides the Laminas mail classes and configuration needed to send emails, manage transports, and integrate with Oro’s mailing features.

View on GitHub
Deep Wiki
Context7

Character Sets

Laminas\Mail\Message assumes a default ASCII character set, and headers and content are quoted accordingly. If you wish to specify alternate characters sets, you will need to:

  • Notify the Message instance of the desired character-set encoding, to ensure headers are encoded correctly.
  • Set an appropriate Content-Type header.
  • In multipart messages, set the character set per-part.

Only in text format

Character sets are only applicable for message parts in text format.

Example

The following example is how to use Laminas\Mail\Message to send a message in Japanese.

use Laminas\Mail\Message;
use Laminas\Mime\Message as MimeMessage;
use Laminas\Mime\Mime;
use Laminas\Mime\Part as MimePart;

// Typically, PHP will use UTF-8 internally; the following converts
// the text to a Japanese encoding.
function convertToJapaneseEncoding($string) {
    return mb_convert_encoding($string, 'ISO-2022-JP', 'UTF-8');
}

$mail = new Message();

// Set message encoding; this only affects headers.
$mail->setEncoding('ISO-2022-JP');

// Set the message content type:
$mail->getHeaders()->addHeaderLine('Content-Type', 'text/plain; charset=ISO-2022-JP');

// Add some headers. Textual content needs to be encoded first.
$mail->setFrom('somebody@example.com', convertToJapaneseEncoding('Some Sender'));
$mail->addTo('somebody_else@example.com', convertToJapaneseEncoding('Some Recipient'));
$mail->setSubject(convertToJapaneseEncoding('TestSubject'));

// Create a MIME part specifying 7bit encoding:
$part = new MimePart(convertToJapaneseEncoding($content));
$part->encoding = Mime::ENCODING_7BIT;

// Create a MIME message, add the part, and attach it to the mail message:
$body = new MimeMessage();
$body->addPart($part);
$mail->setBody($body);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky