BleepingComputer.com: PHP Contact form

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Contact form

#1 User is offline   dzylildvl 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 7
  • Joined: 30-December 09
  • Location:Tucson, Az

Posted 31 December 2009 - 06:36 PM

Here is the scenario, i host websites on a Microsoft 2008 Server with IIS7 and i also have an Exchange 2007 server

what i am trying to do is create an email contact form possibly in either php or asp that will use my exchange server to send the email when someone fills out an submits from the website. Now the email may not go to me but to an external domain that is not on my exchange server.

i know i have probably confused everyone. but its hard to explain

Thanks for any and all help

#2 User is online   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 31 December 2009 - 07:08 PM

Ok, so what is the question?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#3 User is offline   dzylildvl 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 7
  • Joined: 30-December 09
  • Location:Tucson, Az

Posted 31 December 2009 - 08:59 PM

do you know of any way for me to create a form or point me to a tutorial that will let me do this through an exchange server? i have looked all over and have a found a couple of scripts, but they are not working as expected.

#4 User is offline   KamakaZ 

  • Senior Member
  • PipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 548
  • Joined: 26-August 08
  • Gender:Male
  • Location:Victoria

Posted 31 December 2009 - 10:06 PM

It's been a while since i have done this, but from memory, in your php.ini you can configure your SMTP server settings and set the authentication (exchange requires a valid account to relay mail). Then set your php contact form to send the form output to the email address(es) that you want. Should have no problems with this...
If I am helping you and don't reply in 24 hours please send me a PM

There's no place like 127.0.0.1
There are 10 types of people in the world, those that can read binary, and those who can't.

#5 User is online   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 31 December 2009 - 10:51 PM

Quote

but they are not working as expected


Did you get any error messages?
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

#6 User is online   groovicus 

  • Hail Groovicus!
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Moderator
  • Posts: 9,522
  • Joined: 05-June 04
  • Gender:Male
  • Location:Centerville, SD

Posted 01 January 2010 - 04:11 PM

A contact form is simply HTML. One does not make a form 'in' PHP, although one can process the results of a form using PHP. I have a tutorial at the top of the forum that explains how to read data from a form using PHP. Then as kamikaze stated, you need to figure out how to set your php.ini to point to your smtp server.

This is an example of how to mail from PHP:
<?php
$to = "recipient@example.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
  echo("<p>Message successfully sent!</p>");
 } else {
  echo("<p>Message delivery failed...</p>");
 }
?>

"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users