Evo uradio sam mailer i SMTP podesio ali ne znam zbog cega nece. I ne znam zbog cega me redirect na mailer nakon sto stisnem “SEND”. Koristim wordpress.
Evo dio iz footera.
<div id="contact">
<h1>CONTACT ME!</h1>
<form method="POST" action="<?php bloginfo('template_url'); ?>/inc/mailer.php">
<input type="text" placeholder="First & Last name.." name="name">
<input type="email" placeholder="Enter your email..." name="email">
<textarea placeholder="Your message..." name="message"></textarea>
<input type="submit" value="SEND" name="button">
</form>
</div>
Evo mailer.php:
<?php
$emailSubject = "Test Email";
$webMaster = "[email protected]";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Ime i prezime: $name <br>
Poruka: $message <br>
EOD;
$headers = "From $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
$theResult = <<<EOD
<h1>Your message has been sent!</h1>
EOD;
?>
Evo sendmail.ini
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
[email protected]
auth_password=OVDE_STAVIO_PW_OD_RACUNA
[email protected]
php.ini
[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = [email protected]
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"