CMailFile
class CMailFile (View source)
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filepath,$mimetype,$filename,$cc,$ccc,$deliveryreceipt,$msgishtml,$errors_to,$css,$trackid,$moreinheader,$sendcontext,$replyto); $mailfile->sendfile();
Properties
| string | $sendcontext | ||
| string | $sendmode | ||
| mixed deprecated | $sendsetup | ||
| string | $subject | ||
| string | $addr_from | ||
| string | $reply_to | ||
| string | $errors_to | ||
| string | $addr_to | ||
| string | $addr_cc | ||
| string | $addr_bcc | ||
| string | $trackid | ||
| string | $mixed_boundary | ||
| string | $related_boundary | ||
| string | $alternative_boundary | ||
| int<0, 1> | $deliveryreceipt | ||
| ?int<1, 1> | $atleastonefile | ||
| string | $msg | ||
| string | $eol | ||
| string | $eol2 | ||
| string | $error | ||
| string[] | $errors | ||
| SMTPS | $smtps | ||
| Swift_Mailer | $mailer | ||
| Swift_SmtpTransport | $transport | ||
| Swift_Plugins_Loggers_ArrayLogger | $logger | ||
| string|array<string, string> | $css | ||
| ?string | $styleCSS | ||
| ?string | $bodyCSS | ||
| string | $msgid | ||
| string | $in_reply_to | ||
| string | $references | ||
| string | $headers | ||
| string|Swift_Message | $message | ||
| ?string[] | $filename_list | ||
| ?string[] | $mimetype_list | ||
| ?string[] | $mimefilename_list | ||
| ?string[] | $cid_list | ||
| string | $html | ||
| int<0, 1> | $msgishtml | ||
| string | $image_boundary | ||
| int<0, 1> | $atleastoneimage | ||
| array<array{type: string, fullpath: string, content_type?: string, name: string, cid: string}> | $html_images | ||
| array<array{name: string, fullpath: string, content_type: string, cid: string, image_encoded: string}> | $images_encoded | ||
| $image_types |
Methods
CMailFile
Send mail that was prepared by constructor.
Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word
Write content of a SMTP request into a dump file (mode = all) Used for debugging.
Save content if mail is in error Used for debugging.
Correct an incomplete html string
Build a css style (mode = all) into this->styleCSS and this->bodyCSS
Create SMTP headers (mode = 'mail')
Create header MIME (mode = 'mail')
Return email content (mode = 'mail')
Attach an image to email (mode = 'mail')
Try to create a socket connection
This function has been modified as provided by SirSir to allow multiline responses when using SMTP Extensions.
Return a formatted address string for SMTP protocol
Return a formatted array of address string for SMTP protocol
Details
__construct(string $subject, string $to, string $from, string $msg, ?string[] $filename_list = array(), ?string[] $mimetype_list = array(), ?string[] $mimefilename_list = array(), string $addr_cc = "", string $addr_bcc = "", int<0, 1> $deliveryreceipt = 0, int<-1, 1> $msgishtml = 0, string $errors_to = '', string|array<string, string> $css = '', string $trackid = '', $moreinheader = '', $sendcontext = 'standard', $replyto = '', $upload_dir_tmp = '', $in_reply_to = '', $references = '')
CMailFile
bool
sendfile()
Send mail that was prepared by constructor.
static string
encodetorfc2822(string $stringtoencode)
Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word
void
dump_mail()
Write content of a SMTP request into a dump file (mode = all) Used for debugging.
Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25"
void
save_dump_mail_in_err($message = '')
Save content if mail is in error Used for debugging.
@param string $message Add also a message
string
checkIfHTML(string $msg)
Correct an incomplete html string
void
buildCSS()
Build a css style (mode = all) into this->styleCSS and this->bodyCSS
string
write_smtpheaders()
Create SMTP headers (mode = 'mail')
string
write_mimeheaders(?string[] $filename_list, ?string[] $mimefilename_list)
Create header MIME (mode = 'mail')
string
write_body(string $msgtext)
Return email content (mode = 'mail')
string
write_images(array<array{name: string, fullpath: string, content_type: string, cid: string, image_encoded: string}> $images_list)
Attach an image to email (mode = 'mail')
int
check_server_port(string $host, int $port)
Try to create a socket connection
bool
server_parse(resource $socket, string $response)
This function has been modified as provided by SirSir to allow multiline responses when using SMTP Extensions.
static string
getValidAddress(string $address, int $format, int $encode = 0, int $maxnumberofemail = 0)
Return a formatted address string for SMTP protocol
static array<string, ?string>
getArrayAddress(string $address)
Return a formatted array of address string for SMTP protocol