Pages: [1] 2   Go Down
Send this topic | Print
Author Topic: HOWTO: A Contact form WITHOUT sendmail enabled...UPDATED  (Read 8109 times)
TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« on: August 27, 2007, 09:03:16 PM »

Using a contact form without sendmail being enabled.

Requirements:  Fsockopen() enabled and a little php/text editing knowledge (very little!)
Skill level: Easy!

A googlemail or yahoo.au.com account is required.

Download the following zip file:
http://teamyankee.110mb.com/tut-pics/SMTP-contactform.zip

Also the dual e-mail version...

http://teamyankee.110mb.com/tut-pics/smtp-contact-dual-mail.zip

More files here:   http://drive.heartinternet.co.uk/56951687
The one you want is the "SMTP-CONTACT-FORM" or the dual one for sending to 2 e-mails at the same time.

Unzip the file contents into a new folder on your desktop.

In here you will find various files for the script to work.

do not modify - class.smtp.php - this does the actual work.
do not modify - class.phpmailer.php - so does this one...

modify - contact.php - the actual contact form script.
modify - sendit.php - contains the smtp server name and user/password and actually sends the mail using phpmailer.


Modifying the contact form text

Open the contactform.php in your favourite text editor (preferrable crimson editor or notepad2)

On line 12 you will see the following: (you can now also enable "dual" mail sending... one message to 2 mails)

Quote
/******** START OF CONFIG SECTION *******/
  $sendto  = "receivers e-mail address goes here";
//$sendto2 = "second receivers e-mail goes here";  // Just remove the first "//" to enable. Also see the sendit.php file.
  $subject = "Website Contact Enquiry";
 
Modifying this part:

Quote
// Select if you want to check form for standard spam text
  $SpamCheck = "Y"; // Y or N

Y = NO http web links in message
N = Yes.. http allowed

Modify as necessary Wink


Changing the E-mail Message

Scroll down to line 61 and you can modify the body of the e-mail message as you see fit.


Changing the form text
Scroll to line 110 - this contains the text of the form data entry page. Edit as necessary.

You can edit the form text and layout using your "favourite" graphical web editor - like MS Expression web or NVU etc.
- this has been tested as working.
I've not tested it with MS frontpage so I don't know how it handles PHP files. It probably mangles them.

As this web contact form started out as a sendmail form it has redundant code which I've left in to enable a simple return to sendmail operation if needed.

See line 94 to line 98 for the phpmailer modifications


Configuration of the sendit.php file

Open the sendit.php file in a text editor and enter your details for googlemail in the correct places.
This will also work with yahoo.co.au mail - just ammend as needed.
You can also remove the "//" comments to enabledual mail support.

You may change the folder name to anything you want..
Keep all the files together in the same folder or it won't work.

Now it's ready to go...

Use your favourite uploading method and upload all the files into a folder on your website - example is; "form"

To call the web form script just point your browser to:

http://mysite.110mb.com/form/contact.php  and fill in the form.

For a nice and tidy popup window as a contact form use the following code:

In your page header use:
Quote
<script language="JavaScript">
function MailPopUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=550,height=400,left = 340,top = 212');");
}
</script>

In the body section, where you want a contact form link, use:

Quote
<a href="javascript:MailPopUp('../form/contactform.php')"><em>CONTACT FORM</em></a>
Obviously the path should reflect the location of the contactform.php file.

When you submit the form there is a close window button to tidy up the popup window.
It also works fine with popup blockers too.
« Last Edit: July 16, 2008, 07:56:36 PM by TeamYankee » Logged

SuperMario290
Hyper-Active Member
***
Offline Offline

Posts: 328

http://SM290.com


WWW
« Reply #1 on: August 28, 2007, 01:16:35 AM »

Great tutorial  grin, as soon as I get Fsockopen() enabled, I'll sure try it out!  cheesy
Logged

Check out my website - SM290.com
Animal Crossing Addict - AnimalCrossingAddict.com
Free Lancing Designers - FreeLancingDesigners.com
TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« Reply #2 on: September 11, 2007, 01:21:10 AM »

Did you manage to try this out ?
Logged

soren121
I eat lots of those
Advanced Authority Member
*****
Offline Offline

Posts: 1476


I shall stare you down with mah kitteh powahs!


WWW
« Reply #3 on: September 13, 2007, 05:30:24 AM »

Upload the zip somewhere else, because Uploadingit went down.
Logged

LightBlog Developer -- Fueled by Linkin Park, Sprite, and LOLCats
TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« Reply #4 on: September 14, 2007, 01:00:52 AM »

Upload the zip somewhere else, because Uploadingit went down.

I'd love to...  if I still had it!
Logged

Raman
Hyper-Active Member
***
Offline Offline

Posts: 420


Let's Rock D World Again...


WWW
« Reply #5 on: September 14, 2007, 03:02:09 AM »

I am already using the same.... This is phpmailer script... http://phpmailer.sourceforge.net/
Logged

aldo
Official 110mb Guru
********
Offline Offline

Posts: 8004


SMF is ftw :D


WWW
« Reply #6 on: September 14, 2007, 08:04:07 AM »

I'd love to...  if I still had it!
You lucky, lucky, lucky, lucky, lucky, did I mention lucky? lol Person. I emailed it to you. You were the one that emailed me about it right? lol
Logged


TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« Reply #7 on: September 14, 2007, 05:04:05 PM »

I'd love to...  if I still had it!
You lucky, lucky, lucky, lucky, lucky, did I mention lucky? lol Person. I emailed it to you. You were the one that emailed me about it right? lol

I sure did.. that's for the file..  I knew I should have downloaded my files from uploadingit.com when they announced they were in trouble.

I've modified the link on the first post to reflect the new location.  Thanks Aldo!
Logged

aldo
Official 110mb Guru
********
Offline Offline

Posts: 8004


SMF is ftw :D


WWW
« Reply #8 on: September 14, 2007, 11:35:48 PM »

Yup no problem lol. It was in my recycle bin too! cheesy lol. Luckily I am a computer pack rat Duh

I always save cool things for later use Wink
Logged


stereofreak69
Working on 7 Site Network
Super Authority member
******
Offline Offline

Posts: 1735

Need Help? Just PM Me! I'm Happy To Help!


WWW
« Reply #9 on: September 15, 2007, 07:36:48 AM »

Yup no problem lol. It was in my recycle bin too! cheesy lol. Luckily I am a computer pack rat Duh

I always save cool things for later use Wink

Same here...

Stereofreak69
Logged

Hi! I’m a signature virus! Add me to your signature


Current Projects:
     - A 8 Website Network
          1. Arcade Site
          2. Music Site
          3. Techno Site
          4. Script Site
          5. Video Streaming Site
          6. Soundboard Site
          7. Userbar Site
          8. Account Management Site

PM For More Informatio
EnockNamun
www.earthincentives.org
Hyper-Active Member
***
Offline Offline

Posts: 485


WWW
« Reply #10 on: September 20, 2007, 04:06:15 PM »

what is Fsockopen() ?  what are all these things that need to be 'enabled'?  I'm just starting out with php, but it doesn't seem like I'll be able to because of some kind of restrictions?  what ARE these restrictions? and who's restricting them?
Logged

jjyy2006
Active Member
**
Offline Offline

Posts: 53



« Reply #11 on: September 20, 2007, 04:17:41 PM »

Fsockopen is use to allows your script to use SMTP send mail to someone  .you need to pay for $5 or have 30 posts to get Fsocjopen eable. here the link explain this:

http://www.110mb.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=24
Logged

EnockNamun
www.earthincentives.org
Hyper-Active Member
***
Offline Offline

Posts: 485


WWW
« Reply #12 on: September 21, 2007, 02:50:00 AM »

Geez almighty, this is insane.  Could they make it any more difficult?
Logged

TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« Reply #13 on: September 21, 2007, 05:26:56 PM »

Geez almighty, this is insane.  Could they make it any more difficult?

Difficult to do what ?
Logged

TeamYankee
OohRah!
Loyal 110MB Member
*******
Offline Offline

Posts: 2460


Proud PRIUS driver... :-D


WWW
« Reply #14 on: September 24, 2007, 05:11:30 PM »

@team I want a contact similarly like u showed but the problem is i am usin SMF with TinyPortal.I want to integrate the same contact form within the theme. Is it possible to create this form using block sniplet.

You could put the html javascript popup code in the lock snippet and "popup" the form.. or just as a plain link in a new window.

I can't remember if the code block area can run php.. ?
If it does support php then just put the "contactform.php" code in there - you will have to modify the paths to the phpmailer folder.
Still unzip the files into the "/forum/phpmailer/" folder though...

« Last Edit: September 24, 2007, 05:14:28 PM by TeamYankee » Logged

Foneʍoɹɯ®
FoneWorm
Hyper-Active Member
***
Offline Offline

Posts: 272


No words to say....except iTZFREE


WWW
« Reply #15 on: September 24, 2007, 09:09:42 PM »

Yes block sniplet support php and u gave me the right idea thanks alot.
Logged





peterspliid
Hyper-Active Member
***
Offline Offline

Posts: 206


« Reply #16 on: October 31, 2007, 10:45:36 AM »

Thank you soo much!! I finally got the script I need Cheesy
Logged

http://stunt-landia.com - The best GTA San Andreas Server you can find
technoshack
Member
*
Offline Offline

Posts: 30


« Reply #17 on: October 31, 2007, 06:11:40 PM »

Great share! I was trying to figure this out the whole morning today  cheesy
Logged
gollaboy
Member
*
Offline Offline

Posts: 5


« Reply #18 on: October 31, 2007, 09:55:34 PM »

Thanks for share, this is very useful. I will try when my fsockopen enable
Logged
wheretogetiitfree
Member
*
Offline Offline

Posts: 26


« Reply #19 on: December 31, 2007, 12:28:53 AM »

so you can use this for a contact page on your website? ia any one using this that I can see it working?
Logged
Pages: [1] 2   Go Up
Send this topic | Print
Jump to: