Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Perl to Send Japanese Email
Perl script to send Japanese email.
# file: SendJapaneseEmail.pl # This source file was saved using the utf-8 character encoding. use utf8; # Perl script to send email with Japanese characters. use chilkat; $mailman = new chilkat::CkMailMan(); $mailman->UnlockComponent('anything for 30-day trial'); # Set the SMTP server hostname $mailman->put_SmtpHost('smtp.comcast.net'); # If your SMTP server requires a login, set username/password # $mailman->put_SmtpUsername('myUsername'); # $mailman->put_SmtpPassword('myPassword'); # Create a mail message using Japanese characters. $email = new chilkat::CkEmail(); # Indicate that strings are passed using utf-8 $email->put_Utf8(true); $email->put_Subject("私はガラスを食べられます。それは私を傷つけません。"); $email->put_Body("私はガラスを食べられます。それは私を傷つけません。"); $email->put_From('Chilkat Support <support@chilkatsoft.com>'); # Add some recipients $email->AddTo('Matt','matt@chilkatsoft.com'); $email->AddTo('TagTooga','admin@tagtooga.com'); # Chilkat automatically recognizes the Japanese characters and chooses # a typical charset for Japanese email: Shift_JIS. # Had the email contained characters not representable in Shift_JIS (such as Chinese # characters) the component would have automatically chosen utf-8 as the encoding. # The charset used throughout the entire email can be explicitly changed by setting # the Charset property: $email->put_Charset("iso-2022-jp"); # The following line of code is not required for this example. # It saves the MIME source of the email so it can be reviewed # in a text editor. $email->SaveEml("email.eml"); $success = $mailman->SendEmail($email); if (! $success) { $mailman->SaveLastError('lastError.txt'); } |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.