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.

Photo

PHP Contact form


  • Please log in to reply
5 replies to this topic

#1 dzylildvl

dzylildvl

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Tucson, Az
  • Local time:12:54 AM

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

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:54 AM

Posted 31 December 2009 - 07:08 PM

Ok, so what is the question?

#3 dzylildvl

dzylildvl
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Tucson, Az
  • Local time:12:54 AM

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 KamakaZ

KamakaZ

  • Members
  • 739 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Victoria
  • Local time:06:54 PM

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...

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 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:54 AM

Posted 31 December 2009 - 10:51 PM

but they are not working as expected


Did you get any error messages?

#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:01:54 AM

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>");
 }
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users