Solved

PHP-Mail server issue

Posted on 2006-06-30
11
304 Views
Last Modified: 2010-04-20
Hi friends


I am using   mail function  in php to send mail.

when i send the  mail to  yahoo id or gmail id its working fine. But i try to send  third party mail server  , mail can not  be send the third party mail id example (xxxxx@anwssi.com) ,  How its possibe? How can i solve this issue.

Please help me

ETES
0
Comment
Question by:ephrontech
  • 6
  • 3
11 Comments
 
LVL 22

Expert Comment

by:pjedmond
ID: 17016665
Well that's your problem - If sent by mail function in php, many mail providers will treat the mail as spam as the mail will be labelled as an 'automatically mailed' email from a script if you look carefully at the header. You need to get your recipients to 'white list' the address that the email comes from.

AOL will probably treat your email as junk. Many filters will deliver the email, *provided* that there are additional headers in place:

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
   'Reply-To: webmaster@example.com' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

However, unless the server (with the php script on it) that is sending the email has a fixed ip, with the correct registered DNS and reverse DNS configured many addresses will still reject your email. AOL being a typical example.

Unfortunately - a sign of the times:(

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17016684
Alternatively, configure your php script to send mail cia a properly registered email server, or you can try and make the email look moer 'authentic':

$boundary = md5(uniqid(time()));

$headers  = 'From: ' . $from . "\n";
$headers .= 'To: ' . $to . "\n";
$headers .= 'Return-Path: ' . $from . "\n";
$headers .= 'MIME-Version: 1.0' ."\n";
$headers .= 'Content-Type: multipart/alternative; boundary="' . $boundary . '"' . "\n\n";
$headers .= $body_simple . "\n";
$headers .= '--' . $boundary . "\n";
$headers .= 'Content-Type: text/plain; charset=ISO-8859-1' ."\n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n";
$headers .= $body_plain . "\n";
$headers .= '--' . $boundary . "\n";
$headers .= 'Content-Type: text/HTML; charset=ISO-8859-1' ."\n";
$headers .= 'Content-Transfer-Encoding: 8bit'. "\n\n";
$headers .= $body_html . "\n";
$headers .= '--' . $boundary . "--\n";

$mailOk=mail('', $subject,'', $headers);

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:ephrontech
ID: 17016775
Thanks for your replay

Still getting the same problem.In your coding i tried to send mail xxxx@anwssi.com  and check the mail server  i am not receive any message . But i change the "To"  address gmail account Its working fine .
How its possible ?

Please help me.

Thanks
ETES
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 22

Expert Comment

by:pjedmond
ID: 17016791
Depends on the mail server and it's spam filter.

Try and check whether you can send using telnet:

http://www.yuki-onna.co.uk/email/smtp.html

and see what works, and what doesn't. When you find a combination that works, then you need to ensure that you 'duplicate' it in php. Bear in mind that emails sent from the server that you are using may *never* be accepted by xxxx@anwssi.com, however, you will hopefully get a more useful error message usign the telnet approach.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:ephrontech
ID: 17016973


I got "550 Administrative prohibition"     message .How to solve this issue ?  Please help me

Thanks
ETES
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17017635
Which means that the server concerned does not allow you to send emails directly to it. This can be for a number of reasons....including the fact that the email address may be over quota. Contac user and tell them to check their account?

As an aside for future Qs, it would help me and others to give you better input if you phrased your questions better. "
I got "550 Administrative prohibition"     message " is useful, but if you said:

I did 1, then 2, then 3 getting these responses, and when I did 4, I got a "550 Administrative prohibition" message . Here is the cut and paste of th process (obviously *** out anything sensitive):

------8X---------
1
adfa
2
zdfcsf
3
zadfasdf
4
asdadf
550 Administrative prohibition
------8X---------

then you'd get better answers, and more people are likely to be able to assist.

(   (()
(`-' _\
 ''  ''
0
 

Author Comment

by:ephrontech
ID: 17017743
I did

telnet mail.domain.com 25
Trying 66.xx.18.6...
Connected to rose.domain.com (66.xx.18.6).
Escape character is '^]'.
220-rose.domain.com ESMTP Exim 4.52 #1 Fri, 30 Jun 2006 06:21:29 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
HELO local.domain.name
250 rose.domain.com Hello local.domain.name [66.xx.18.6]
MAIL FROM:prabhu@xxxxx.com
250 OK
RCPT TO:members@xxxxxx.com
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
Subject:-testttt-

hello members@xxxxxxx.com from prabhu@xxxxxx.com
.
550 Administrative prohibition


I got this error messsge ,Any idea ,please help me

Thanks
ETES
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 17017799
Much better Q;)

Looks like their mailbox is over quota, or the person concerned has a 'spam' filter (or other configuration of the individual account concerned) rejecting the email. Also possible that the email concerned does not exist.

(   (()
(`-' _\
 ''  ''
0
 
LVL 22

Accepted Solution

by:
pjedmond earned 500 total points
ID: 17017854
Another cause of this is that you may need to 'POP' before SMTP. This means that you must have logged in and authenticated with the same server via POP within a period of say 10 minutes prior to trying to send an email:

http://pages.prodigy.net/michael_santovec/pop3telnet.htm

This ensures that only authenticated users can use the SMTP server concerned.

(   (()
(`-' _\
 ''  ''

0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question