Spam Email sent via mail() function

E-Mail I send from my php page is considered as spam.

Page 1 of 1

8 Replies - 2279 Views - Last Post: 24 January 2010 - 10:50 AM Rate Topic: -----

#1 dedou  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 07-September 09

Spam Email sent via mail() function

Post icon  Posted 24 January 2010 - 07:58 AM

Hi guys,

I've created a page in which I send an email.

I use PostCast server and I have cnfigured all the settings correctly. (smtp port, php.ini etc.)

However when I send an emai it is considered as spam. The mail cannot be sent to gmail, hotmail or yahoo servers as it is blocked (possible spam). But it's sent to my school's server with a warning for possible spam.

here's the code of the page:
<?php
$to	  = 'dimitrisdedou@gmail.com';
$subject = 'xaxaxa';
$message = 'hello sflkmslfmsdfmsdlkfmsldmflskdmfldsf';
$headers = 'From: unknown@dasakd.com' . "\r\n" .
	'Reply-To: unknown@dasakd.com' . "\r\n" .
	'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
If (mail($to, $subject, $message, $headers))
echo"yoooo";
else
"malakia egine";
?>


Are there any functions that will help me avoiding all those things?
Thanks in advance. :)

Is This A Good Question/Topic? 0
  • +

Replies To: Spam Email sent via mail() function

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2927
  • View blog
  • Posts: 10,116
  • Joined: 08-August 08

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 08:28 AM

If you're sending from your school's network then it should get to your school's server without a problem. Your school's ISP is another story. Their servers typically will block outgoing mail if they don't recognize the account it is being sent from, and I doubt that unknown@dasakd.com will be recognized.

This post has been edited by CTphpnwb: 24 January 2010 - 08:29 AM

Was This Post Helpful? 0
  • +
  • -

#3 dedou  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 07-September 09

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 08:34 AM

Actually, I send it from my apache server to my schools server. I used to send it with my hotmail account and I changed it to unknown@adask.com just for testing purposes as the result was the same. My school's server has nothing to do with it. Just, Its security isn't that good to block my spam mail (as google and yahoo does...).
Was This Post Helpful? 0
  • +
  • -

#4 AverageGuy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 23-January 10

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 08:42 AM

View Postdedou, on 24 Jan, 2010 - 07:34 AM, said:

Actually, I send it from my apache server to my schools server. I used to send it with my hotmail account and I changed it to unknown@adask.com just for testing purposes as the result was the same. My school's server has nothing to do with it. Just, Its security isn't that good to block my spam mail (as google and yahoo does...).

Is there any information in the headers that would tell you what it didn't like? I think some of the spam filters put comments in the header. I've seen it out of spamassassin. I agree with the previous poster that you definitely will be banned by some sites without a valid email address.

Jim.
Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2927
  • View blog
  • Posts: 10,116
  • Joined: 08-August 08

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 08:58 AM

Apache => School => ISP => intenet
Apache => School: √
School => ISP: isp doesn't recognize your account and/or doesn't allow relaying through the school's server, so it blocks the message.

ISP => internet: Yahoo, GMail, etc., all have their own spam blocking systems.

My guess is that the ISP doesn't like relaying.
Was This Post Helpful? 0
  • +
  • -

#6 dedou  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 07-September 09

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 09:31 AM

So what should i do to solve it? What's the source of my problem? Thanks for the answers anyway. :)
Was This Post Helpful? 0
  • +
  • -

#7 dedou  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 07-September 09

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 09:41 AM

View PostAverageGuy, on 24 Jan, 2010 - 07:42 AM, said:

View Postdedou, on 24 Jan, 2010 - 07:34 AM, said:

Actually, I send it from my apache server to my schools server. I used to send it with my hotmail account and I changed it to unknown@adask.com just for testing purposes as the result was the same. My school's server has nothing to do with it. Just, Its security isn't that good to block my spam mail (as google and yahoo does...).

Is there any information in the headers that would tell you what it didn't like? I think some of the spam filters put comments in the header. I've seen it out of spamassassin. I agree with the previous poster that you definitely will be banned by some sites without a valid email address.

Jim.


This is the mail that I get in my school's adress inbox. The sender now was dedomits@hotmail.com which is a valid e-mail.:

Spam detection software, running on the system "pythia", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.

Content preview: hello sflkmslfmsdfmsdlkfmsldmflskdmfldsf [...]

Content analysis details: (7.8 points, 6.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
1.6 TVD_RCVD_IP TVD_RCVD_IP
3.3 TVD_RCVD_IP4 TVD_RCVD_IP4
1.1 FORGED_HOTMAIL_RCVD2 hotmail.com 'From' address, but no 'Received:'
1.6 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address
[62.1.248.200 listed in dnsbl.sorbs.net]
0.1 RDNS_DYNAMIC Delivered to trusted network by host with
dynamic-looking rDNS

----

The content I sent was just the following:
hello sflkmslfmsdfmsdlkfmsldmflskdmfldsf

All the other text is output of the security system of my school's server.
Was This Post Helpful? 0
  • +
  • -

#8 AverageGuy  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 23-January 10

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 10:02 AM

View Postdedou, on 24 Jan, 2010 - 08:41 AM, said:

View PostAverageGuy, on 24 Jan, 2010 - 07:42 AM, said:

View Postdedou, on 24 Jan, 2010 - 07:34 AM, said:

Actually, I send it from my apache server to my schools server. I used to send it with my hotmail account and I changed it to unknown@adask.com just for testing purposes as the result was the same. My school's server has nothing to do with it. Just, Its security isn't that good to block my spam mail (as google and yahoo does...).

Is there any information in the headers that would tell you what it didn't like? I think some of the spam filters put comments in the header. I've seen it out of spamassassin. I agree with the previous poster that you definitely will be banned by some sites without a valid email address.

Jim.


This is the mail that I get in my school's adress inbox. The sender now was dedomits@hotmail.com which is a valid e-mail.:

Spam detection software, running on the system "pythia", has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn't spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.

Content preview: hello sflkmslfmsdfmsdlkfmsldmflskdmfldsf [...]

Content analysis details: (7.8 points, 6.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
1.6 TVD_RCVD_IP TVD_RCVD_IP
3.3 TVD_RCVD_IP4 TVD_RCVD_IP4
1.1 FORGED_HOTMAIL_RCVD2 hotmail.com 'From' address, but no 'Received:'
1.6 RCVD_IN_SORBS_DUL RBL: SORBS: sent directly from dynamic IP address
[62.1.248.200 listed in dnsbl.sorbs.net]
0.1 RDNS_DYNAMIC Delivered to trusted network by host with
dynamic-looking rDNS

----

The content I sent was just the following:
hello sflkmslfmsdfmsdlkfmsldmflskdmfldsf

All the other text is output of the security system of my school's server.


Nslookup can't find your IP address, That's probably what's tripping the first two rules. I'm assuming you are on a box with a dynamic ip address. One way to help the problem would be to purchase a domain name or go with a free one from someone like freedns. http://freedns.afraid.org/

They can give you a script that needs to be run periodically on your system to update their tables. Then hopefully the sites will find a real domain name associated with your IP address and the score will be lower. A lot of the spam comes from sites that report only their IP address in the headers. That's why they add a high score to messages with that issue.

Jim.
Was This Post Helpful? 0
  • +
  • -

#9 dedou  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 07-September 09

Re: Spam Email sent via mail() function

Posted 24 January 2010 - 10:50 AM

I already have a free domain in No-IP.

This is the site actually:
http://tmoddsgame.no...rg/tm_odds_game
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1