[eluser]osci[/eluser]
maybe send it from another server? or from another email.
Being treated as spam has nothing to do with the code to send emails apart from not sending all emails at once, thus limiting the number of recipients and send in intervals.
It mostly has to do with something wrong with your mail server or email. Servers are reported as spam, dynamic ips are not considered reliable too - which makes me think of "are you sending from localhost btw?".