35

B-oxmail : Wordpress Plugin – Sidebar E-mail Form

Posted August 2nd, 2009 in Wheels by Ankit

This small widget will add a form to sidebar, which will allow visitors to send an e-mail/feedback directly from any page without visiting the contact page. The widget came into existence out of personal need, when some of the visitor on my blog where posting general queries in comments instead of mailing me.

Some Features :

  • AJAX based to prevent page reload. (0.1+)
  • CAPTCHA verification to prevent spams. (0.1+)
  • Most of the Settings can be Changed from Admin Panel.(0.1+)

If you find the widget helpful, I would encourage you to send me a feedback for improvement.

Version 0.2 (1/August/2009) : First release of Widget B-oxmail.
known bugs : CAPTCHA not working on some of the servers. Fixed with version 0.2.2.

Download Page

Installation :

  1. Upload `b-oxmail` folder to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Add the widget to sidebar from Appearance > Widgets
  4. Settings can be changed at Settings > Boxmail Settings

screenshot-1

screenshot-2

35 Responses so far.

  1. Adam Adam says:

    Installed, changed the mail settings so that my mail information is included (although this isn’t mentioned in the ReadMe or elsewhere) and activated.

    The CAPTCHA image doesn’t appear and the appropriate file in the plug-in remains inactive.

    Thoughts?

    • Ankit Ankit says:

      @Adam
      I am new to this wordpress plugin thing. Made a standalone script first, and whatever I could get from tutorials online, I converted it to wordpress widget.
      Still not use to with few things like the file names – plugin folder is “b-oxmail” and main file is “boxmail.php”.

      Captcha and Mail is working absolutely fine on Test sites (my local wamp server and this site itself). I don’t know why captcha is not working on your site. CAPITALIZATION MATTERS IN THIS CAPTCHA.
      I will appreciate if you could point out the bugs so I can fix them :)

      Thanks.

  2. milko milko says:

    dude, wonderful plugin, except it doesn’t work! I’m having the same problem as the other fellow, with the captcha and by the way the image is not showing on this very page either, you have a test version up in the left — no captchah. you’ve go my mail, please let me know if you come up with something

    • Ankit Ankit says:

      @ milko
      Its fixed now. I made the changes so CAPTCHA image is created on Fly without requiring background base.

      your comment was quite encouraging that I fixed it right away :)

  3. milko milko says:

    awesome man, I like your ajax pluginthingie better than tiny contact, let’s hope it works. (expect acknowledgement on my site if it does ;)

  4. baron baron says:

    Works great, thank you

  5. that’s great, I’m absolutely going to use this. it’ll give my clients a chance to contact me at any point during there viewing experience. Thanks!!

  6. [...] This small widget will add a form to sidebar, which will allow visitors to send an e-mail/feedback directly from any page without visiting the contact page. Very handy! View Plugin [...]

  7. gerodot gerodot says:

    hello!

    How call your widget like function in theme? I need this feature in header.

    Thanks

    • Ankit Ankit says:

      @gerodot
      I have to check for that in wordpress documentation. Already mentioned that I am new to this wordpress widget thingie.

      If you are asking for making your theme widget enabled, then add the following code wherever required.

      1
      2
      3
      
      <?php if ( !function_exists('dynamic_sidebar')
              || !dynamic_sidebar() ) : ?>
      <?php endif; ?>

      Tell me if it solves the problem. Otherwise, I’ll look for the function call.

  8. Lane Lane says:

    Great idea! And it’s working great on my website.

    It seems that the apostrophe cannot be used in the messages:
    I’ll becomes I\\’ll

    The word “receive” is misspelled in the Settings Mail Back default message. The admin can change it, but why not do a favor for those who don’t know they should?

    • Ankit Ankit says:

      @Lane
      Thanks Lane. It will be fixed in next release.

      didn’t noticed the spelling mistake. :P Thanks for pointing out that also.

  9. Malila Malila says:

    This plugin comes out top in simplicity compared to others listed in the wordpress plugin directory. i like it, but since it seems to be still young, i would like to add some thoughts for further development: checkbox if name, email, (maybe even a subject field) and message are required or optional, option to send a copy to self, akismet support. show message “Sorry the Captcha is not Valid !” while users still can correct it. no other form plugin seems to be able to do all that so far …

    • Ankit Ankit says:

      @Malila
      Thanks For Your suggestion. I am really pleased at your suggestions. I will Include your suggestions in next update. A bit busy with some other coding stuff, but you can expect next release by end of this month.

      Thanks again :)

  10. [...] 4. B-OXMAIL (EMAIL NA SIDEBAR) Este pequeno plugin/widget adiciona uma caixa de subscrição, que permite aos visitantes enviar um e-mail/feedback directamente e a partir de qualquer página do seu blog, sem necessitarem de visitar a página de contactos. Muito útil em determinados casos específicos e/ou para quem recebe grandes quantidades de emails/contactos. [...]

  11. Ana Maria Ana Maria says:

    Hi there.

    Is there a function call to embed your plugin into the template instead of using the widgets settings? Widgetizing does not work good for me (it’s not the best for more complex templates).

    Cheers

    • Ankit Ankit says:

      @Ana Maria
      Not yet. Someone asked for the same thing before. See above comments.

      However, I’ll figure it out soon. Just wait for the next release of the widget (by the end of this month).

  12. robert hancock robert hancock says:

    For some reason it will not activate although I can see it in the list of inactive plugins. tried twice with two downloads and same problem each time.
    WP 2.7.1.

  13. robert hancock robert hancock says:

    This is the error:
    atal error: Class ‘WP_Widget’ not found in /hermes/bosweb/web032/b324/glo.focuscubed/blog/wp-content/plugins/b-oxmail/b-oxmail.php on line 20

    • Ankit Ankit says:

      @robert hancock

      Its currently tested on 2.8+ version of wordpress.

      Will make it comaptible with older versions of WP in very next release. You have to wait for that for few more weeks. Next update is expected to be out by 30th of this month.

  14. Douglas Douglas says:

    Hi. I really like the plug-in. Maybe I missed it reading through the comments thread, but it would be great if I could configure it so that the commenter would be _required_ to leave an email address so that I can follow up.

  15. Keila G. Keila G. says:

    Hello,

    Thanks for a great plugging, however, I was wondering if there is a possibility to customize it a little and wave the text msg box? the reason I`m asking is since I only need the name and email info from readers for a certain need in my blog (you should check it out then you`d understand why…;) and saving on space would be great.

    Please let me know,
    Thanks,
    Keila.

    • Ankit Ankit says:

      @Keila G.

      Open “b-oxmail.php” file from plugin editor, and delete the following lines

      141
      142
      143
      144
      
      <label>
          			<textarea name="message" id="BoxFormField" cols="16" rows="5" onFocus="this.value=''; return false;" ><?php echo $CONFIG_BOXMAIL['initial_message_value']; ?>
          			</textarea>
        			</label>

      It will remove the Message box. Hope it will help. Let me know if you face any problem.

      @puzzled94
      Can I see link to your site ? I may able to help better then

  16. puzzled94 puzzled94 says:

    Hi,
    I like the simplicity of the plugin, but I can’t get the captcha to work. It appears after selecting continue whereupon I enter the captcha only to be told ‘Sorry the Captcha is not Valid !’
    I can see that other users are able to get it to work.
    Any ideas?

  17. kevin kevin says:

    I emailed you directly before I saw the comments lol
    Should I post here as well?

    Great plugin. Everything works great and even added more fields.

    Just curious if you know how to change the default sender email, it seems to pull from the server using a default email and didnt see a place where to change the sent from email address. Really prefer to have it sent from the sites email and not the servers default.

    • Ankit Ankit says:

      @kevin
      Great changes to plugin you did. ;)

      Anyways, mail function is in “mail.php” file. I’ll consider the changes in next update.

      Here are the lines you need to modify.

      12
      13
      14
      15
      
      @mail($CONFIG_BOXMAIL['admin_email'], $CONFIG_BOXMAIL['email_subject'],
      "Name : ".$_POST['fullname']."<br />".
      "Email : ".$_POST['email']."<br />".
      "Message : ".$_POST['message']."<br />" ) or die('There was an error sending the mail');

      and replace them with.

      12
      13
      14
      15
      16
      17
      
      @mail($CONFIG_BOXMAIL['admin_email'],$CONFIG_BOXMAIL['email_subject'],
      "Name : ".$_POST['fullname']."<br />".
      "Email : ".$_POST['email']."<br />".
      "Message : ".$_POST['message']."<br />",
      "From: ".$_POST['fullname']."\nReply-To: ".$_POST['fullname']."\nContent-Type: text/html")
      or die('There was an error sending the mail');

      This will make the Sender Name and E-mail as default. Hope I typed the code correctly, in case not just make the changes accordingly :)

  18. kevin kevin says:

    Thanks so much for the reply and your willingness to help.

    I added the line and makes the form not work.

    I added – “From: “.$_POST['fullname'].”\nReply-To: “.$_POST['fullname'].”\nContent-Type: text/html”) and with the OR DIE line and all combination of the line you gave.

    When I add it after hitting submit the box goes white and no email is sent. Not sure if he additional fields I added are altering it.

    This is my current code.
    mail($CONFIG_BOXMAIL['admin_email'], $CONFIG_BOXMAIL['email_subject'],
    “Name : “.$_POST['fullname'].”\n”.
    “Email : “.$_POST['email'].”\n”.
    “Phone : “.$_POST['phone'].”\n”.
    “Domain name : “.$_POST['domain name'].”\n”.
    “Message : “.$_POST['message'] ) or die(‘There was an error sending the mail’);

  19. kevin kevin says:

    I am so stupid lol
    This whole time been using my email to test, thinking that was the email I was sending to customer.

    In reality it is just sending me the form and who cares what email it is from since I am the only one seeing it. lol

    Sorry for the trouble.

  20. Ankit Ankit says:

    @kevin

    oopsie….The above code has bit of error. I used ‘fullname’ info at both places. just use this line for header field in mail function. Mailed you the screenshot also.

    "From: ".$_POST['fullname']."<".$_POST['email'].">\nReply-To: ".$_POST['email']."\nContent-Type: text/html")

    And, BTW your question is completely valid. In this way you won’t have to type that person’s e-mail again. You can simply use “Reply” in your mailbox. I am using this modified code on my site..

    The plugin is bit outdated, and I plan to add few things as soon as I get time to update it. can’t commit any date at this point.