Python Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Python Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
Socket / SSL
SFTP
SMTP
Spider
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

Python to Send Japanese Email

 Chilkat Python Module Downloads for Windows, Linux, and MAC OS X

Python script to send Japanese email.

# file: SendJapaneseEmail.py
# -*- coding: utf-8 -*-

# This Python source file uses the utf-8 encoding.

import chilkat 

# How to send Japanese email in Python
mailman = chilkat.CkMailMan()
mailman.UnlockComponent("anything for 30-day trial")

# Set your SMTP server's 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 simple email, using Japanese characters anywhere possible.
email = chilkat.CkEmail()
# Indicate that input strings are utf-8
email.put_Utf8(True)
email.put_Subject("私はガラスを食べられます。")
email.put_Body("私はガラスを食べられます。それは私を傷つけません。")
email.put_From("を傷つけ <support@chilkatsoft.com>")

# Add a few recipients
email.AddTo("れます","matt@chilkatsoft.com")
email.AddTo("ラスを","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")
	
success = mailman.SendEmail(email)
if (not success):
	mailman.SaveLastError("lastError.txt");


 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.