Email from html form

Ohkay so i have my contact page and my form and im trying to send emails straight from the form. i have a contact.php and im using xampp to test it . only problem is nothing happens. nothing sent to email nothing sent to mailoutput folder just nothing happens :confused: any help would be greatly appreciated!
also i have no experience in php at the moment . i do plan on learning but im just trying to finish this site for now lol thanks everyone! :slight_smile:

https://www.dropbox.com/sh/o5fjie5c41mhlmy/AABHSWd39eNjAt48IrdUSXIQa?dl=0
heres the files

The PHP mail() function doesn’t in itself send the email. It sends to an email server that sends the email.

AFAIK it is possible to set up an email server on your computer, but I don’t know the whats or hows.

Maybe MailCatcher would work well enough for testing purposes?

https://mailcatcher.me

If you’re running XAMPP you will need to have Mercury up and running to be able to send emails. Either than or replace the PHP mail() function with PHPMailer or a similar mail class.

1 Like

Hi there lennycourvoisier,

Have you tried testing the contact form on your host server?

I tested it on my host server and found that the ā€œcontact.phpā€
file had just one error.

The ā€œmail functionā€ā€¦

/* Send the message using mail() function */
mail($myemail, $message);

…requires at least three parameters…

/* Send the message using mail() function */
mail($myemail,"Contact Subject Here", $message);

coothead

1 Like

ohkay i added subject to the code. and still nothing :confused: excuse my ignorance ; i cant seem to understand this whole process with php and email servers and such. also i dont have a host server

Hello Leny, I have not seen your code but I think if the code is all correct then the local host can be the issue. You need to upload the files to a real hosting server and then try.

If you don’t have real hosting then can you use someone’s others… like friends or others…

Well, what is the point of having a contact form without
publishing it to the world? :wonky:

If you give me your email address I will put your form on
my site for you to test my assertion that it works OK. :winky:

coothead

I am eventually going to publish it when i know it all works lol ; i pm’d you my email thank you so much for all the help

1 Like

Hi there lennycourvoisier,

here is your contact form for you to test…

http://coothead.co.uk/lennycourvoisier/contact.html

coothead

1 Like

It works! lol thank you!! So the code i have works ? And how do i go about publishing it? Again please excuse my ignorance this is my first site lol

when you find your host ensure that it supports PHP.

Upload the folder in this attached zip file to your host…

lennycourvoisier.zip (239.0 KB)

…and you’re good to go. :sunglasses:

Hopefully. :rolleyes:

coothead

Thanks man i appreciate all the help :slight_smile: how do i know which ones support php?

You check the package specifications or simply ask the proprietor if not sure. :winky:

You can also use this little info.php file to check it completely.

<?php
   phpinfo();
?>

Test it on your XAMPP. :sunglasses:

coothead

Ohkay will do ; thanks again! :slight_smile: oh i noticed in the link you gave me to test my form that the background of my images are white instead of transparent ; is that how its gonna be when i publish the site?

Hi there lennycourvoisier,

I just took the images from your link…

www.dropbox.com

…so if they were originally transparent then ā€œdropboxā€
has, obviously, somehow corrupted them. :eek:

That should not be a problem for you, as I presume
that you still have the pristine originals. :winky:

Just replace them as necessary. :sunglasses:

If you don’t have them, then let me know and I will
remove the white for you. :biggrin:

coothead

I was aware that one could save png files and ā€œlose transparencyā€.

But I didn’t know there was a way to restore transparency once it was gone.

You have a better image editing app than I have (Paint and IrfanView)?

I have Paint, IrfanView, Photoshop and Fireworks,
the last two being rather good at removing stuff.

I don’t know if they can restore lost transparency though. :shifty:

coothead

2 Likes

I use Fireworks daily and they can’t restore transparencies unless some how the layers haven’t merged during the loss of transparency. Then it’s possible, but very unlikely because during a merge, the image then acts like a jpg hence why it loses transparency. Only jpg loses transparency while creating an image. Both gif and png typically keep transparencies when they are created if the image does include a transparent background. The other way I know is to use the Magic Tool to remove parts that you think may have been merged during the conversion. So if the background turned black when it was uploaded, then you’ll have to select a large portion of the black background. What I typically like to do if there is no transparent background is to remove everything in the background up to the smallest pixels. Even though this may take time, for me, it’s worth it at the end.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.