DD24 PHP Mailer Usage

Aus DD24 Wiki

Wechseln zu: Navigation, Suche

This neat PHP Skript enables you to easily integrate a page to send out e-mails.

Simply integrate the script in the site which confirms the delivery of the e-mail. The filename of this page must end in .php NOT .htm NORE .html). Therein the following line must be contained:

 <? require_once("dd24_send_mail.inc.php"); ?>

This code don´t have to be deposited in the page, which contains the input fields for the e-mails.

Thereby you can find the following input parameter:
subject : Subject of the mail (optional)
recipient : E-Mail Adr. of the addressee
contains : List of those fields, which will be inserted in the content of the e-mail
requires : Fields, which CAN NOT be empty (optional)
from : E-Mail Adr. of the of the sender (optional)
charset : Character set of the e-mail (optional)
message_success : Report after a sucessful delivery (optional)
message_fail : Report in the case of an failed dispatch (optional)

For example

Feed in data:

<form action='mailSend.php' method='post'>

    <input type='hidden' name='from' value='info@meinedomain.de'>
    <input type='hidden' name='recipient' value='addressee@mydomain'>
    <input type='hidden' name='subject' value='testmail'>
    <input type='hidden' name='contains' value='name, email, a text , a checkbox'>
    <input type='hidden' name='requires' value='name, email'>
    <input type='hidden' name='message_success' value='Email sent'>
    <input type='hidden' name='message_fail' value='error '>

    Name: <input name='name'><br>
    Email: <input name='email'><br>
    Text: <textarea name='einText'>Beispieltext</textarea><br>
    click me: <input type='checkbox' name='eineCheckbox' value='gewaehlt'><br>
    <input type='submit'>

</form>

send e-mail and confirm dispatch (mailSend.php):

<html>
<body>

<p>Thanks for your mail!</p>

<? require_once("dd24_send_mail.inc.php"); ?>

</body>
</html>
Persönliche Werkzeuge