# $email_name_pair is a variable specify a email and name # $name can be undef,set $name=undef if $name eq '' # $email_name_pair can be a string # A: "$email" # B: "$name $email" if not A # C: "$email $name" if not A,B # D: "\"$name\"<$email>" if not A,B,C # E: "$name<$email>" if not A,B,C,D # $email can be a array_ref # A: [$email,$name] # B: [$name,$email] if not A # $email can be a hash_ref # {email=>$email,name=>$name}

# the rule of $file # 1,you "must and can only" set one of file_path and file_bin,or will throw an exception # 2,if file_name set, {file_name}=file_name # 3,if file_name not set and file_path set,then {file_name} will be generate by file_path # 4,if file_name not set and file_path not set and content_id set,then no {file_name} # 5,if content_type set，then {content_type}=content_type # 6,if content_type not set and {file_name} set，then {content_type} will be generate by {file_name} # 7,if content_id set,then consider this file as part of multi_related structure，else if content_id not set then consider this file as part of multi_mixed structure };

# extra rules: # from is must set # to and cc must contains more than one valid email # if (input is all unicode or input is all ascii){ # src_encoding can be not set # }else{ # src_encoding must set # } # dst must set # in to cc bcc, [$email,$email] is parse as two receiver email

$email_name_pair is a variable specify a email and name
$name can be undef,set $name=undef if $name eq ''
$email_name_pair can be a string:
A: "$email"
B: "$name $email" if not A
C: "$email $name" if not A,B
D: "\"$name\"<$email>" if not A,B,C
E: "$name<$email>" if not A,B,C,D
$email can be a array_ref:
A: [$email,$name]
B: [$name,$email] if not A
$email can be a hash_ref:
{email=>$email,name=>$name}

$file is a hash_ref with below options :
file_path
#path to file
file_bin
#binary content of file
file_name
#file name
content_type
#content type
content_id
#content_id, when u wanna embed picture in html email u need it
the rule of $file:
1,you "must and can only" set one of file_path and file_bin,or will throw an exception
2,if file_name set, {file_name}=file_name
3,if file_name not set and file_path set,then {file_name} will be generate by file_path
4,if file_name not set and file_path not set and content_id set,then no {file_name}
5,if content_type set，then {content_type}=content_type
6,if content_type not set and {file_name} set，then {content_type} will be generate by {file_name}
7,if content_id set,then consider this file as part of multi_related structure，else if content_id not set then consider this file as part of multi_mixed structure