Add files
This commit is contained in:
40
index.php
Normal file
40
index.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
// for testing use only. Please define user, password and host in a config file of your own
|
||||
$mail = new MailWrapper();
|
||||
|
||||
$mail
|
||||
->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")
|
||||
->prepare();
|
||||
|
||||
$content = <<<EOL
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p>Hello,</p>
|
||||
<p>This is a sample test message</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
EOL;
|
||||
|
||||
try
|
||||
{
|
||||
$mail->send("Test message", $content);
|
||||
|
||||
}
|
||||
catch (Exception $ex)
|
||||
{
|
||||
echo "Problem while sending mail! " . $ex->getMessage();
|
||||
}
|
Reference in New Issue
Block a user