Witam Mam problem z obsługą wysyłki maila ze strony ale może po kolei: - Poniżej formularz: Code: <form id="main-contact-form" name="contact-form" method="post" action="sendemail.php"> <div class="form-group"> <input type="text" name="name" class="form-control" required="required" placeholder="Name"> </div> <div class="form-group"> <input type="email" name="email" class="form-control" required="required" placeholder="Email Id"> </div> <div class="form-group"> <input type="subject" name="subject" class="form-control" required="required" placeholder="subject"> </div> <div class="form-group"> <textarea name="message" id="message" required="required" class="form-control" rows="8" placeholder="Your text here"></textarea> </div> <div class="form-group"> <input type="submit" name="submit" class="btn btn-submit" value="Submit"> </div> </form> - A tu skrypt PHP PHP: <?php$name = $_POST['name']; $from = $_POST['email']; $subject = $_POST['email']; $message = $_POST['message']; $to = 'mój_mail@gmail.com';$headers = array();$headers = "MIME-Version: 1.0";$headers[] = "Content-type: text/plain; charset=utf-8";$headers[] = "From: {$name} <{$from}>";$headers[] = "Reply-To: <{$from}>";$headers[] = "Subject: {$subject}";$headers[] = "X-Mailer: PHP/".phpversion();mail($to, $subject, $message, $headers); - plik php.ini PHP: SMTP = serwerxxxxxx.home.pl smtp_port = 465username = mail@domena.plpassword = haslo W momencie gdy wysyłam owego maila ze strony wysyłka jak najbardziej przechodzi ale dostaje maila z adresu bardzo dziwnego bo: serwerxxxxx@serwerxxxxxx.home.pl bez tematu, bez treści, bez niczego. Siedzę już nad tym kilka dni i nie bardzo wiem jak to ugryźć.
robisz to źle. Mam nadzieję, że to jedynie formularz naukowy a nie, taki który wrzucisz na stronę. to : jest zbędne. Reszta "problemu" została już wcześniej zgłaszana i nawet chyba rozwiązana tu na forum.
Hej Tak tak to naukowy Próbuje to jakoś okiełznać ale coś nie idzie. Znalazłem post poniżej https://forum.home.pl/threads/phpma...-jak-dodac-odpowiedni-from-oraz-reply-to.290/ Tylko że wstawiając kod PHP: <?phprequire_once 'class.phpmailer.php';$_POST = array_map('trim', $_POST);$mail = new PHPMailer();$mail->CharSet = 'UTF-8';$contact_name = strip_tags($_POST['name']);$contact_email = strip_tags($_POST['email']);$mail->AddReplyTo($contact_email, $contact_name);$mail->SetFrom("mail@który_istnieje_na_serwerze_home.pl");$mail->AddAddress("mail_do _wysyłki@gmail.com");$mail->Subject = 'Wiadomość ze strony WWW';$mail->Body = "Nazwa firmy: ".$_POST['name']."\nAdres e-mail: ".$_POST['email']."\nTreść wiadomości: ".$_POST['message']; Kompletnie nic się nie dzieje - nic nie dochodzi.
włącz error_reporting i powiedz co tam się dzieje. Looknij na podobnie brzmiący problem tu: https://forum.home.pl/threads/e-mail-ze-strony-www.4039/