[code] <?php
$text = “Error! Please try again. ”;
if(isset($_POST[‘submitcontact’]))
{
$name=$_POST[‘name’];
$email=$_POST[‘email’];
$message=$_POST[‘message’];
$to = "rishabh@mysrconline.tk";
$subject = "SRC Contact Form";
$message = " Name: " . $name ."\r\n Email: " . $email . "\r\n Message:\r\n" . $message;
$from = "Mysrconline.tk Contact Form";
$headers = "From:" . $from . "\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8" . "\r\n";
if(@mail($to,$subject,$message,$headers))
{
$text = "<span style='color:blue; font-size: 35px; line-height: 40px; margin: 10px;'>Your Message was sent successfully !</span>";
}
}
?> [/code]
My mail is not received at the other end can anyone tell me what’s the possible error in the code I’ve checked the spam folder of my gmail too but no msg from this code
Do you have sendmail enabled in Settings > General in your website panel?
Yes its enabled
I’m creating a contact form actually
Can anyone help me out on coding if its wrong
Thank you
teodor
June 12, 2017, 5:14pm
#5
Hi @rrishabh035 !
When you submit a form, button values are not submitted. So, your if
statement from line 3
will always encounter false
return.
You should remove it.
still its not working not receving the mail at the other end my gmail account not also on spam box
[code]
<?php
$text = "
Error! Please try again. ";
$name=$_POST['name'];
$email=$_POST['email'];
$message=$_POST['message'];
$to = "rishabh@mysrconline.tk";
$subject = "SRC Contact Form";
$message = " Name: " . $name ."\r\n Email: " . $email . "\r\n Message:\r\n" . $message;
$from = "Mysrconline.tk Contact Form";
$headers = "From:" . $from . "\r\n";
$headers .= "Content-type: text/plain; charset=UTF-8" . "\r\n";
if(mail($to,$subject,$message,$headers))
{
$text = "
Your Message was sent successfully ! ";
}
?> [\code]
still im not receiving mails at the other end not on spam box too
ive removed if and isset line with paranthesis as you said please look
thank you brother
teodor
June 13, 2017, 9:09am
#9
Your form is working, but I see you are trying to send e-mails to rishabh@mysrconline.tk
…
Make sure the mailing redirect is configured correctly…
Yes mail forwarder is working I’ve checked it by mailing it with another account …
But I’m not getting mails through form
teodor
June 13, 2017, 9:57am
#11
I have sent you two e-mails using the script code you have provided. Did you received them?
Not getting mails from you too … if anyone sends it from gmail to rishabh@mysrconline.tk it works but from php code idk what’s happening
teodor
June 13, 2017, 10:44am
#14
I have forwarded this issue to administrators. Please be patient
Hey nginx and everyone thanks all of you for your concern , now my contact form is working fine I’ve replaced rishabh@mysrconline.tk with my original gmail account
teodor
June 13, 2017, 2:38pm
#17
…You mean, your previous gmail account was not valid?
Mail function with rishabh@mysrconline.tk is not working though I had linked it with my gmail account in cpanel but when I used mail function with gmail address it worked
Ex mail(rishabh@mysrconlin.tk ,…) Is not working
While mail(rrishabh035@gmail.com , …)
Worked !!!
1 Like
With link I mean email forwarder
teodor
June 13, 2017, 3:41pm
#20
Oh, that’s natural…
I thought you wanted to use rishabh@mysrconlin.tk
specifically for different reasons, otherwise I would’ve suggested you that fix first.
Is there any good book to learn php advance coding