Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['submitted'])) {
- $message = 'This is a Testmessage by '.$_POST['Name'];
- $email = 'root@localhost';
- $username = 'root';
- $password = '1234';
- $mail_method = 'stmp';
- $smtp_host = 'smtp_host'; // e.g. localhost
- $smtp_port = 25;
- $to_email = 'mail@receiver';
- $sendmail = new Email;
- $sendmail->protocol = $mail_method;
- $sendmail->smtp_user = $username;
- $sendmail->smtp_pass = $password;
- $sendmail->smtp_host = $smtp_host;
- $sendmail->smtp_port = $smtp_port;
- $sendmail->mailtype = 'html';
- $sendmail->from($email, 'test name');
- $sendmail->to($to_email);
- $sendmail->subject('Mail form on site: ' . URL_PUBLIC);
- $sendmail->message($message);
- $sendmail->send();
- } else { ?>
- <form method="post">
- <input type="hidden" name="submitted" value="1" /><br />
- <input type="text" name="Name" value="" />
- <input type="submit" value="Submit feedback" />
- </form>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement