setHost("smtp.spacejewel-hosting.com") // can be anything that has a mail server ->setProtocol("tls") // auto sets the port ->setAuthPassword("examplepassword") ->setFullyQualifiedAddress("exampleuser") ->setRecipient("johndoe@example.com") ->setReplyto("someone@example.com") ->setFrom("someone@example.com", "From Name Here") ->prepare(); $content = <<

Hello,

This is a sample test message

EOL; try { $mail->send("Test message", $content); } catch (Exception $ex) { echo "Problem while sending mail! " . $ex->getMessage(); }