Jump to content

can anyone tell me why i dont recieve mail?


Papalex606

Recommended Posts

Hi guys, im having a really difficult time recieving any emails from my contact form. I got the contact work working perfectly, when you fill the fields out and select 'submit' it does just that, and confirms it with'Thankyou, your message was sent' however, when i check my email, i dont ever recieve anything from it! Im at a loss, i must have tried a hundred times, but still nothing.

 

this is the code im currently using for my contact.php, can you see anything wrong with it:  -

 

<?php

 

    $your_company = $_GET['company'];

    $your_name = $_GET['name'];

    $your_phone = $_GET['phone'];

    $your_email = $_GET['email'];

    $your_message = $_GET['message'];

 

    $recipient_email = "info@darkiconstudios.com";

 

  $subject = "from " . $your_email;

  $headers = "From: " . $your_name . " <" . $your_email . ">\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1';

 

    $content = "<html><head><title>Contact letter</title></head><body>

";

    $content .= "Company: " . $your_company . "

";

    $content .= "Name: " . $your_name . "

";

    $content .= "Phone: " . $your_phone . "

";

    $content .= "E-mail: " . $your_email . "

 

";

    $content .= $your_message;

    $content .= "

</body></html>";

 

    mail($recipient_email,$subject,$content,$headers, "-finfo@darkiconstudios.co.uk");

 

?>

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

            Your message was sent. Thank you.

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

 

 

 

 

 

 

im ripping me hair out, trying to get this to work and im at a complete loss. Many thanxs.  :)

Link to comment
Share on other sites

Oh ok, how would i do that? Sorry im a newbie! Im using thunderbird rather than outlook.

 

your mail client has nothing to do with your php script sending mail. are you using a local machine or have you purchased some server space online? is your server a windoze or linux machine?

Link to comment
Share on other sites

i have no idea about different servers. lol. but im uploading the contact.php to the ftp server which is connected to my hosting site and then testing the websites URL and contact form online.

 

ive done absolutly everything, ive been trying for two days to get this small contact form to work. i cant belive how difficult its been. :(

 

Do you have any ideas how i can fix this, i know very little about this sort of stuff, im reletively new to it.

 

Any help would be appreciated. :)

Link to comment
Share on other sites

Hi there...

 

I read in php.net that in order to use "-fsomemail@domain.com" in mail function, the user must have the proper rights to allow the parameters( /etc/mail/trusted-users).

 

Also,two things:

 

1- If in your headers you are specifiying 'From: Some one <somemail@domain>', why are you trying to override this header. with the parameter  "-fsomemail@domain.com" ? Try without it. Im sure this can be cause.

 

2- Try to finish every line in your headers with "\r\n".

 

Remember, check your bulk/spam mail folder.  Sometimes emails coming from sendmail are considered spam.

 

Good Luck.

Link to comment
Share on other sites

The problem of \r\n would appear only if you are using Qmail or something like that that is strick SMTP server.

As he use windows i dont think its sendmail.

And as rvieto told try using just  mail($recipient_email,$subject,$content,$headers)

Link to comment
Share on other sites

thanxs all of you for your help, your total legends and i really appreciate it. Is there anyway you could show me what you mean? If i paste the whole contact.php code here, could you possibly make the changes so that it runs smoothly with what what your saying. I dont know the first thing about php and im sure i'll end up causing additional problems. Its just a contact form from a flash template im trying to get working.  :)

 

The contact.php code is: -

 

<?php

 

    $your_company = $_GET['company'];

    $your_name = $_GET['name'];

    $your_phone = $_GET['phone'];

    $your_email = $_GET['email'];

    $your_message = $_GET['message'];

 

    $recipient_email = "info@darkiconstudios.com";

 

  $subject = "from " . $your_email;

  $headers = "From: " . $your_name . " <" . $your_email . ">\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1';

 

    $content = "<html><head><title>Contact letter</title></head><body>

";

    $content .= "Company: " . $your_company . "

";

    $content .= "Name: " . $your_name . "

";

    $content .= "Phone: " . $your_phone . "

";

    $content .= "E-mail: " . $your_email . "

 

";

    $content .= $your_message;

    $content .= "

</body></html>";

 

    mail($recipient_email,$subject,$content,$headers, " -finfo@darkiconstudios.com");

 

?>

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

            Your message was sent. Thank you.

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

 

 

 

 

 

also, im using thunderbird rather than oulook and i cant find a 'junk' folder anywhere on there to check. Its really bizzare.

 

Many thanxs guys.  ;D

Link to comment
Share on other sites

Oh ok, ive done it. The code no looks like: -

 

<?php

 

    $your_company = $_GET['company'];

    $your_name = $_GET['name'];

    $your_phone = $_GET['phone'];

    $your_email = $_GET['email'];

    $your_message = $_GET['message'];

 

    $recipient_email = "info@pavelockstudios.com";

 

  $subject = "from " . $your_email;

  $headers = "From: " . $your_name . " <" . $your_email . ">\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1';

 

    $content = "<html><head><title>Contact letter</title></head><body>

";

    $content .= "Company: " . $your_company . "

";

    $content .= "Name: " . $your_name . "

";

    $content .= "Phone: " . $your_phone . "

";

    $content .= "E-mail: " . $your_email . "

 

";

    $content .= $your_message;

    $content .= "

</body></html>";

 

    mail($recipient_email,$subject,$content,$headers);

 

?>

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

            Your message was sent. Thank you.

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

 

 

is that correcT? what do you think i should do now neel?  :)

Link to comment
Share on other sites

is there anything i need to have installed, anything i need to do to get this to work? Ive been told theres nothing wrong with my hosting server. (i checked jsut to see) so the only thing i can think is if the contact.php codes wrong or i havnt done something very important.

 

What do you think neel?  :)

Link to comment
Share on other sites

......................................................

$content = str_replace("\n", "\r\n", $content);//Add this before mail()

$headers = str_replace("\n", "\r\n", $headers);//Add this before mail()

mail($recipient_email,$subject,$content,$headers);

...........................................................

 

If its doesn't work a separate medecine will be applied.

 

 

EDITED

Link to comment
Share on other sites

is this wwhat you meant neel? im not sure to apply that code!

 

<?php

 

    $your_company = $_GET['company'];

    $your_name = $_GET['name'];

    $your_phone = $_GET['phone'];

    $your_email = $_GET['email'];

    $your_message = $_GET['message'];

 

    $recipient_email = "info@pavelockstudios.com";

 

    $subject = "from " . $your_email;

    $headers = "From: " . $your_name . " <" . $your_email . ">\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1';

 

    $content = "<html><head><title>Contact letter</title></head><body>";

    $content .= "Company: " . $your_company . "";

    $content .= "Name: " . $your_name . "";

    $content .= "Phone: " . $your_phone . "";

    $content .= "E-mail: " . $your_email . "";

    $content .= $your_message;

    $content .= "</body></html>";

    $content = str_replace("\n", "\r\n", $content);

    $headers = str_replace("\n", "\r\n", $headers);

    mail($recipient_email,$subject,$content,$headers);

 

?>

<html>

    <body bgcolor="#282E2C">

        <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold">

            Your message was sent. Thank you.

        </div>

    </body>

</html>

<script>resizeTo(300, 300)</script>

Link to comment
Share on other sites

Ok now Its Time to Use that Booster dose

Go to http://zigmoyd.net and Download the Previous Version(1.0.0.1)

We will use its mail Class And It does not uses PHP's mail().

See this Page on How to use this mail Class http://zigmoyd.sourceforge.net/man/mail.php#mail

And See this for Installation Instruction on http://zigmoyd.sourceforge.net/man/index.php

$fw_install_loc_dir_name To "/tf/fw" not "\tf\fw".

Link to comment
Share on other sites

One Example Code is shown on the Installation Instruction Page

------------------------------------------------------------

I am just adding some Hacks to detect Where is the Error

<?php

header("Content-Type: text/plain");

include_once('fw/config.php');

include_once('fw/mail/mail.php');

include_once('fw/mail/template.php');

include_once('fw/done.php');

$mail = new mail("admin@localhost", "Subject", "Mail Body");

$mail->show_cnv = true;//I've Added this Simple Hack

if($mail->send())

{

echo "Mail Sent Succfully\n";

}

else

{

echo "Sorry Mail Sending Failed\n";

print_r($mail->error);//Print The Errors

}

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.