Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Mail help

the mail() function

Moderators: macek, egami, gesf

Mail help

Postby py1337 » Fri Feb 03, 2012 3:44 pm

My mail() script is working fine. But the problem is that people are spamming i.e sending random mails which is causing hell to my inbox+junk folder.
I am thinking to restrict each IP for only sending 2 emails, that is IP can only send 2 emails, for sending more he will have to change his IP. so in this way I think this spam would decrease.

so anyway or can some one help me to code this ? or directly give me php code.
py1337
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Feb 03, 2012 3:30 pm

Re: Mail help

Postby py1337 » Sat Feb 04, 2012 9:10 am

anyone ???or no one has it's answer ??
py1337
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Feb 03, 2012 3:30 pm

Re: Mail help

Postby rhender » Mon Feb 06, 2012 12:26 pm

I imagine that this is a form validation issue.

I read a book by Charles Wyke Smith that included a function for validating simple forms.

I can send it to you - the function - , and possibly help you out.

Just let me know. Spam sucks.
rhender
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Re: Mail help

Postby py1337 » Wed Feb 08, 2012 2:19 pm

yeah sure, send me .
Thank you!
py1337
New php-forum User
New php-forum User
 
Posts: 3
Joined: Fri Feb 03, 2012 3:30 pm

Re: Mail help

Postby rhender » Wed Feb 08, 2012 2:53 pm

Hi there,

All of the code I'm referring to is actually in a few posts down, that I started a thread for.

It's called "designating who email is from" or something like that.

The last post in that thread is where I pasted the code that I am using, from the book I read by Charles Wyke Smith... I think that's his correct name. It has the code for validating the form submission.

And yes, I got your private message, but figured it was easier just to post here. Good luck,
rhender
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Re: Mail help

Postby pradeepcarya » Tue Feb 28, 2012 10:42 pm

hi..can u send me mail function to snd mail.

actually i need this for sending mails to users but not getting any mail function which actually works practically.also tell me if i need to change any settings for doing mail.
pradeepcarya
New php-forum User
New php-forum User
 
Posts: 22
Joined: Mon Oct 24, 2011 10:10 am

Re: Mail help

Postby pradeepcarya » Tue Feb 28, 2012 10:42 pm

hi..can u send me mail function to snd mail.

actually i need this for sending mails to users but not getting any mail function which actually works practically.also tell me if i need to change any settings for doing mail.
pradeepcarya
New php-forum User
New php-forum User
 
Posts: 22
Joined: Mon Oct 24, 2011 10:10 am

Re: Mail help

Postby rhender » Wed Feb 29, 2012 9:38 am

This is just the code for validating the form.

I called it form-validation.php, and I have it in an "_includes" folder... it came from the Charles Wyke Book I was talking about.

Let me know if you need more help.

Code: Select all
<?php

function verifyAlphaNum ($testString) {
   // Check for letters, numbers and dash, period, space and single quote only.
   return (eregi ("^([[:alnum:]]|-|\.| |')+$", $testString));
}   

function verifyEmail ($testString) {
   // Check for a valid email address
   return (eregi("^([[:alnum:]]|_|\.|-)+@([[:alnum:]]|\.|-)+(\.)([a-z]{2,4})$", $testString));
}

function verifyText ($testString) {
   // Check for letters, numbers and dash, period, ?, !, space and single and double quotes only.
   return (eregi("^([[:alnum:]]|-|\.| |\n|,|\r|\?|\!|\"|\')+$",$testString));
}

function verifyPhone ($testString) {
   // Check for only numbers, dashes and spaces in the phone number
   return (eregi('^([[:digit:]]| |-)+$', $testString));
}

?>
rhender
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am


Return to PHP coding => Mail

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.