Ph: 14092005

Support

PXS Mail Form - WP Plugin

General
— by Phrixus14-09-2005 | Categories:

Current Version 2.6

Download Now

How long till V3.0? I am getting very close to finishing off the very new and very cool rewrite of the contact form. It is sleeker, safer and more customizable that the current version… help keep me motivated by showing your appreciation….. ;-)


If not a donation, how about jumping off your Amazon search from this box. I am collecting vouchers for some new code reference books… they will help me with the contact form ;-)

[ http://rcm-uk.amazon.co.uk/e/cm?t=encaptured-21

The current download is a new version that has some neat new features and better compatibility. It has a CC Sender option and no longer requires a seperate admin options file. If you have any previous versions, please delete the options-pxsmail.php file from the wp-admin directory. There is also a different code for the page where you want the form inserted so that it should now be compatible with the RTE editor in WP 2+. The Charset used is now pulled from the blog settings so I hope this helps where people have had issues!As always, please let me know if there are any problems!

Overview

PXS Mail Form was originally based on the contact form layout by Ryan Duff. I have expanded on his plugin by including various checks on the entered data and including an optional automatic redirect on successful transmission. The plugin will also check that the email address entered is in the correct format.
The latest update is eaier to use, allows you to deactivate the CSS injection from the options page.
Now cross references the quality of the content with a new referrer check. By ensuring that both the content is not dangerous and that a special md5 key matches information in the form, exploits should be harder to complete. In addition, if an exploit attempt is made, the script will quietly return to the homepage offering no feedback or warnings about this to the user. The plugin can send to multiple recipients and it will even create a drop-down menu if required to allow the user to select a recipient. See the instructions below.
I also suggest that it is only used on a page.
Latest features include the option to allow the sender to copy the message to themself, option to allow the user to add their own subject, completely new CSS and layout code for compatibility. Install and check the options page to see what you can do!

Requirements

PXS Mail Form has been built and tested on Wordpress 1.5.2 and 2.0RC3

Installation

1. Copy pxsmail.php into the /wp-content/plugins/ directory.
2. Go to the plugin manager and activate ‘PXS Mail Form‘.
3. Go to Options > PXS-Mail and update your email address and any other options you wish to change. To disable the automatic redirect, leave the destination field empty.
4. Add {mailform} to the page where you want the form to be inserted.

Sending to only one address
Simply enter 1 email address on the options page .

Sending to a group with no select menu
Enter a list of email addresses on the options page seperated by commas email@domain.com,email@domain2.com,email@domainx.com

Sending to a group with a select menu
You need to enter a list of email addresses on the options page, but you also need to specify the value that will be displayed in the menu and the subject that will be sent with the email. Use the following syntax email@domain.com,Person 1,Subject 1;email@domain2.com,Person 2,Subject 2 . The menu will be automatically displayed as the first field of the mail form. Note that each group is seperated by a ‘;’ and the variables are seperated by a ‘,’.

Sending to a group with a select menu and the option to send to all
Use the same system as above but create the last entry with ‘all’ as the email address as in this example email@domain.com,Person 1,Subject 1;email@domain2.com,Person 2,Subject 2;all,To All,Subject to all . The Menu option and subject are customisable as usual.

Update 12th September 2005:
I have finally updated the plugin and should fix a few issues that people were having.
There is now the option to turn off the CSS injection for those that would rather have the CSS in their own stylesheet. You can find the code used by the plugin at the end of the ‘pxsmail.php’ file. The option to turn this off is on the options page in your admin area.
As with the prior release, it should be placed on its own page or after the <!��more��> tag.

Update 13th September 2005:
Now cross references the quality of the content with a new referrer check.

By ensuring that both the content is not dangerous and that a special md5 key matches information in the form, exploits should be harder to complete. In addition, if an exploit attempt is made, the script will quietly return to the homepage offering no feedback or warnings about this to the user.

The new update should ensure that it is much more secure against spammers trying to exploit the script. If anyone receives any evidence that it has been compromised, please let me know and I will try to secure it again.

Update 14th September 2005:
Now works with the Markdown plugin.

Update 21st September 2005:
This major update adds a new feature as requested in the comments. The plugin can now send to multiple recipients and it will even create a drop-down menu if required to allow the user to select a recipient.For instructions on using these features, see the instructions above.

Update 21st December 2005: V2.5
The plugin now only has one file, the options file is no longer required. The code to insert the form has changed to {mailform} and should be compatible with the WP 2 RTE editor. There is a new option to show a ‘CC Myself’ box on the form… should be obvious what this does!

Update 23rd December 2005: V2.6
More new features and (hopefully!) much better CSS compatibilty with different themes and browsers. This code has been completely rewritten so please let me know if/when you have any layout problems! Another new option has been added that allows the sender to enter their own subject. If allowed, a subject will be shown on the form. If this is left blank, the default subject will be used. When using the multi-mail feature, the entered subject will be appended to the subject defined in the multi-mail code.

Good luck and please contact me if you have any difficulties or leave a comment below to help out other users!

The previous list of comments has been archived due to the size of the page… they can still be viewed here.


Additional Related Entries

PXSmail Updated
PXSmail - Updated again!
PXS Mail Form - WP Plugin
My First Plugin - PXS Mail Form

444 Responses to “PXS Mail Form - WP Plugin”

Pages: « 4544 43 42 41 40 [39] 38 37 36 35 341 » Show All

Get your own Gravatar at Gravatar.com

#390

Thanks for the copmments everyone.

@Ozh, bear in mind that this version was originally created in March 05 and has been hacked around witha lot. I have been rewriting the new plugin from scratch using all I have learnt in the last 3 years to make it as reliable as possible…. its also much prettier!!!

Comment by Phrixus — 20/4/2007 @ 10:30 am

Get your own Gravatar at Gravatar.com

#389

Rather nice plugin.

As a plugin (amateur) coder myself though, I must say that your coding style is not the prettiest. Way too generic function names (’get_ip()’ is sure to conflict any time with another function in a plugin or WP core itself for example) and there’s way too many options added in the db while a single entry with an array of your options could be enough and more efficient.

Comment by Ozh — 20/4/2007 @ 10:22 am

Get your own Gravatar at Gravatar.com

#388

I wanted to have two different versions of the mailform for my website. After reading through the comments I decided to replace the string “pxs” to “pxxs” (for the whole file) and then search for the string “function” in the script. Most functions have been changed to pxxs…. with the exception of a few such as ValidateEmail or getip. I then did a search for ValidateEmail and replaced it with ValidateEmail_. And so on. Next search for “mailform” and change it to something different, which you will then have to use within your post to call the function {mailform_new}.

Then rename the actual php script (pxxsmail.php) and upload it. Voila. Check under plugins/options . . .

I too ran into the problem with the destroyed function error messages and duplicate mails. I had originally called the function from a post, I changed this then into a post instead and it worked just fine.

Now you can go and search within the script for “blog” for example. You will find the place where the field “Website” is populated in the form. And a few more places where some checks are being done and the $fullmsg variable being filled. Some creative copy/paste and suddenly I had two different Email forms.

Many thanks for the script, Phrixus.

PS: I am sure there is a better way of doing it, but hey, I am not a php junky, just some trial and error. And I thought I’ll share. Hope this helps somebody somehow

Comment by Markus — 13/4/2007 @ 12:12 am

Get your own Gravatar at Gravatar.com

#387

[...] The Wordpress plugin PXS Mail form offers you a sofisticated and easy to instal / use mail form. [...]

Pingback by Rothemund » Blog Archive » Wordpress plugin: PXS Mail Form — 4/4/2007 @ 10:00 pm

Get your own Gravatar at Gravatar.com

#386

Instead of reading 39 pages of comments to see if this has been asked, Ill just ask again.

I get a lot of spam through this, is there going to be some sort of captcha in the new version?

Comment by Dave — 23/3/2007 @ 8:18 pm

Get your own Gravatar at Gravatar.com

#385

Mark,
Thats interesting to note… thanks for the findings!!!

James,
Those are good points that have been covered in V3 of the plugin. I think your example will benefit those users using the current version as I am not releasing the next version just yet. Thank-you for posting this here!!

Comment by Phrixus — 23/3/2007 @ 12:45 am

Get your own Gravatar at Gravatar.com

#384

Hi Phrixus,

First just wanted to say great plugin. Second, I noticed a couple of places where I think some improvements could be made. Hope it’s okay, but I am including the improvements here in a comment.

1 - You use preg_replace when swapping out the {mailform} tag with the form. This is slow and not required. Here is what I replace it with:

return str_replace(’{mailform}’, $form, $content);

2 - When WP calls psx_callback, it does a ton of stuff before actually checking if the form is required on a post. So right at the top of the psx_callback function I include the following two lines:

global $post;
if (($post->post_type != ‘page’) || !strpos(’{mailform}’,$content)) return $content;

So essientially, I make $post global so we have access to it here. Then I check to see if we are on a ‘page’ (this only work in 2.1 with my check, though making it work in lesser versions would be easy) and not a post, and finally use strpos to see if {mailform} is in this content, and if either requirement is not met, we get out before doing anything else.

Perhaps I am way off base here, but having to run a preg_match on every post on my site, everytime a page is loaded seemed a bit over kill.

Hope this helps.

Comment by James — 21/3/2007 @ 7:33 pm

Get your own Gravatar at Gravatar.com

#383

I earlier reported (as did others) that I was getting five copies of every email (five, because that’s how many posts I have on my home page). That problem has now stopped. I changed two things: (1) I’m on Apache not IIS. (2) My permalink structure no longer includes /index.php/

I don’t know which change solved the problem though!

Comment by Mark Barnes — 21/3/2007 @ 12:19 am

Get your own Gravatar at Gravatar.com

#382

Scott,
I am not sure what you mean, check this site which is 2.1 and the form is working fine.

Comment by Phrixus — 18/3/2007 @ 8:26 pm

Get your own Gravatar at Gravatar.com

#381

Are you going to update it for WordPress 2.1 and above? It’s broke in that version.

Comment by Scott — 18/3/2007 @ 7:42 pm

Pages: « 4544 43 42 41 40 [39] 38 37 36 35 341 » Show All

Leave a Reply


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser