Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

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.

auto send email when a form is submitted

Featured Replies

I have a basic form which makes a submission to a database. Works great.

What I desire is to have an email submitted to a fixed address simultaneously upon submission of the form.

I explored the demo/examples posted on various PHP sites and tried incorporating them into my form, without success. I then tried to just make a form whose sole purpose is to submit an email, and I could not make that work either.

I am using the built-in Apache Server on OSX Jaguar. There was mention in one article of the need to adjust the httpd.config file. Actually the article was about the Windows .ini file. I searched httpd.config but could find none of the lines they mentioned.

Two questions:

1) Could my problem be a matter of adjusting httpd.config, or should those be OK as-is?

2) Could someone point me to an example page (or provide general tips) which does the submit & email combo I desire?

Thanks, as always, for the push.

DSW

Are you trying to send the email from PHP? Are you using a script like this:

<?php

	$email = $_POST["email"];

	$message = $_POST["message"];

	

	if (mail("[email protected]", "The Subject", $message, "From: " . $email . "rn" . "Cc: [email protected]"))

			{

			include "mailsent.html";

			}

		else

			{

			include "mailerror.html";

			};

?>

If it is not already enabled, you may have to "enable" PHP on your computer by editing the httpd.config file.

Good Luck.

Garry

  • Author

Garry,

Thanks for writing back so quickly.

My email send page looks very much like that. I have tried a number of different wrinkles based on the examples I have found and no longer think my coding is the issue here.

Any ideas about where/how I should adjust the httpd.config file? I looked through it and it was not clear to me where I should adjust it.

Thanks again.

DSW

  • Author

Garry,

Here is a bit more info on my situation.

PHP version 4.3.2.

phpinfo gives:

Local Value Master Value

sendmail_from no value no value

sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i

SMTP localhost localhost

smtp_port 25 25

I have explored the httpd.conf file too, but haven't found any likely places for making changes to it.

Would you be able to comment on these settings, let me know what changes I might consider, and/or point me towards an info source on this topic?

You should not need to do anything with httpd.conf

My php mail() stopped working recently when my ISP blocked port 25! This is OK for me because I am just developing here and I have plenty of hosted sites to do the final testing on.

Maybe it is a port 25 issue?

Good Luck.

Garry

  • Author

Garry,

Thanks again. I'll try it on a different machine.

With appreciation,

DSW

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

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.