?
Solved

PHP-Mail server issue

Posted on 2006-06-30
11
Medium Priority
?
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 
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 2000 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

719 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