Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how do i configure the mail() function

Featured Replies

Hey guyz, am kinda new around here....am a web designer and also a web programmer, i currently code in php...i've been having problems with the mail function ever since i started coding.....i've also tried uploading my script to test online but it still does'nt work....below is the said script....i wanna plead with u guyz to at least take time out to review my script and help me check to see if there are any mistakes..

 

<?php

$form = "

<form action=\"test.php\" method=\"post\">

<input type=\"hidden\" name=\"seenform\" value=\"y\">

<b>Send us your comments!</b><br>

Your Name:<br>

<input type=\"text\" name=\"name\" size=\"20\" maxlength=\"20\" value=\"\"><br>

Your Email:<br>

<input type=\"text\" name=\"email\" size=\"20\" maxlength=\"40\" value=\"\"><br>

Your Comments:<br>

<textarea name=\"comments\" rows=\"3\" cols=\"30\"></textarea><br>

<input type=\"submit\" value=\"submit!\">

</form>

";

// If we haven't already seen the form ($seenform passed by hidden

// form value), show the form.

if ($seenform != "y") :

print "$form";

else :

$to = "lawillas4ever@yahoo.com";

$subject = "$name has sent you a comment";

$headers = "From: $email";

$message = "Good day Admin

 

A visitor to your website has just filled in a comment.

 

Find details below:

Name: $name

 

Email: $email

 

Comments: $comments";

$eno = "mail($to,$subject,$message,$headers)";

if( $eno):

print "Thank you $name for taking a moment to send us your comments!";

endif;

endif;

?>

As a matter of fact, I was thinking about putting a contact form on my portfolio site that I am working on. I haven't put it online, but i will post eventually or when i think that it is smoking hot.

 

Back on subject, I am looking over your code and I don't like the way you did that. I think you should just keep the form just a regular form. Because you don't want to jumble it with php if you don't have to, it just makes another thing to worry about or troubleshoot.

 

I am not sure how much you know about php, but I will recommend two sites that I think will help you out a little or at least point you in the right direction.

 

http://www.tizag.com/phpT/forms.php Basics on form with php

http://www.tutorialtastic.co.uk/tutorial/p...e_and_protected - free php mail handler. I havnt tested this site yet, but ifyou have any problems let me know.

 

Again, I hope this helps. Let me know how it turns out or if you need help any further.

 

-John

  • 1 month later...
Hey guyz, am kinda new around here....am a web designer and also a web programmer, i currently code in php...i've been having problems with the mail function ever since i started coding.....i've also tried uploading my script to test online but it still does'nt work....below is the said script....i wanna plead with u guyz to at least take time out to review my script and help me check to see if there are any mistakes..

 

<?php

$form = "

<form action=\"test.php\" method=\"post\">

<input type=\"hidden\" name=\"seenform\" value=\"y\">

<b>Send us your comments!</b><br>

Your Name:<br>

<input type=\"text\" name=\"name\" size=\"20\" maxlength=\"20\" value=\"\"><br>

Your Email:<br>

<input type=\"text\" name=\"email\" size=\"20\" maxlength=\"40\" value=\"\"><br>

Your Comments:<br>

<textarea name=\"comments\" rows=\"3\" cols=\"30\"></textarea><br>

<input type=\"submit\" value=\"submit!\">

</form>

";

// If we haven't already seen the form ($seenform passed by hidden

// form value), show the form.

if ($seenform != "y") :

print "$form";

else :

$to = "lawillas4ever@yahoo.com";

$subject = "$name has sent you a comment";

$headers = "From: $email";

$message = "Good day Admin

 

A visitor to your website has just filled in a comment.

 

Find details below:

Name: $name

 

Email: $email

 

Comments: $comments";

$eno = "mail($to,$subject,$message,$headers)";

if( $eno):

print "Thank you $name for taking a moment to send us your comments!";

endif;

endif;

?>

 

 

Your code is using strings that have not been declared anywhere and

assuming your server is running a default version of PHP5 you cant get away with lazy strings anymore:

 

if ($seenform != "y") 

 

should be:

 

if ($_POST["seenform"] != "y") 

 

and so on.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.