to = "unknown@domain.com"; $mail->subject = "This is the subject"; $mail->setBody( new ezcMailTextPart( "This is the body" ) ); $transport->send( $mail ); // Sending a mail with an attachment using ezcMail $mail = new ezcMail(); $mail->to = "unknown@domain.com"; $mail->subject = "This is the subject"; $body = new ezcMultipartMixed(); $body->appendPart( new ezcMailTextPart( "This is the body" ) ); $body->appendPart( new ezcMailFilePart( "~/file.bin" ) ); $transport->send( $mail ); // sending an html mail with a plain text alternative and // an attachment using ezcMail $mail = new ezcMail(); $mail->to = "unkown@domain.com"; $mail->subject = "This is the subject"; $alt = new ezcMailMultipartAlternative(); $alt->appendPart( new ezcMailTextPart( "This is the body" ) ); $alt->appendPart( $html = new ezcMailTextPart( "This is the body" ) ); $html->subType = "html"; $body = new ezcMultipartMixed(); $body->appendPart( $alt ); $body->appendPart( new ezcMailFilePart( "~/file.bin" ) ); $transport->send( $mail ); // The previous example using the convinience class // ezcMailComposer $mail = new ezcMailComposer(); $mail->to = "unknown@domain.com"; $mail->subject = "This is the subject"; $mail->setPlainTextBody( "This is the body" ); $mail->setHTMLBody( "This is the body" ); $mail->addAttachment( "~/file.bin" ); $transport->send( $mail ); ?>