473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Sending mail with mail() without header

Hi,

I'm working on a website where there is a from from which I want to
send the data by e-mail.

When I send myself the result with mail($my_email, $title, $message)
everything works fine and I receive a plain text email. However, the
people for which I'm doing the site receive some kind of error when I
do the same thing but delivered to them mail($their_email, $title,
$message)

The error looks something like this:

Your message cannot be delivered to the following recipients:

Recipient address: se******@theirdomain.com
Reason: Illegal host/domain name found

I also used something like this in the script to make it work when
sending it to myself:

ini_set('SMTP', 'mail.theirdomain.com');
ini_set('sendmail_from', 'se******@theirdomain.com');

Is it the fact that I send this email in plain text with no headers
that could trigger some sort of spam filtering?

If so, what headers should I be using?

Thanks in advance
Jul 28 '08 #1
5 1702
Hi,
>
I'm working on a website where there is a from from which I want to
send the data by e-mail.

When I send myself the result with mail($my_email, $title, $message)
everything works fine and I receive a plain text email. However, the
people for which I'm doing the site receive some kind of error when I
do the same thing but delivered to them mail($their_email, $title,
$message)

The error looks something like this:

Your message cannot be delivered to the following recipients:

Recipient address: se******@theirdomain.com
Reason: Illegal host/domain name found

I also used something like this in the script to make it work when
sending it to myself:

ini_set('SMTP', 'mail.theirdomain.com');
ini_set('sendmail_from', 'se******@theirdomain.com');

Is it the fact that I send this email in plain text with no headers
that could trigger some sort of spam filtering?

If so, what headers should I be using?

Thanks in advance
I can't give a lot of detail, but it's because the Headers are non-RFC
compliant, I imagine. Without the envelope "from" and "return path"
etc. many ISPs will reject the mail. I imagine someone who can give you
specific details will be along shortly.

HTH
Jul 28 '08 #2
Thanks for this piece of info.

It helps to know where the problem comes from.

On Jul 28, 11:26*am, "Twayne" <nob...@devnull.spamcop.netwrote:
Hi,
I'm working on a website where there is a from from which I want to
send the data by e-mail.
When I send myself the result with mail($my_email, $title, $message)
everything works fine and I receive a plain text email. However, the
people for which I'm doing the site receive some kind of error when I
do the same thing but delivered to them mail($their_email, $title,
$message)
The error looks something like this:
Your message cannot be delivered to the following recipients:
*Recipient address: servi...@theirdomain.com
*Reason: Illegal host/domain name found
I also used something like this in the script to make it work when
sending it to myself:
* *ini_set('SMTP', 'mail.theirdomain.com');
* *ini_set('sendmail_from', 'servi...@theirdomain.com');
Is it the fact that I send this email in plain text with no headers
that could trigger some sort of spam filtering?
If so, what headers should I be using?
Thanks in advance

I can't give a lot of detail, but it's because the Headers are non-RFC
compliant, I imagine. *Without the envelope "from" and "return path"
etc. many ISPs will reject the mail. *I imagine someone who can give you
specific details will be along shortly.

HTH
Jul 28 '08 #3
Thanks for this piece of info.
>
It helps to know where the problem comes from.

On Jul 28, 11:26 am, "Twayne" <nob...@devnull.spamcop.netwrote:
>>Hi,
>>I'm working on a website where there is a from from which I want to
send the data by e-mail.
>>When I send myself the result with mail($my_email, $title, $message)
everything works fine and I receive a plain text email. However, the
people for which I'm doing the site receive some kind of error when
I do the same thing but delivered to them mail($their_email,
$title, $message)
>>The error looks something like this:
>>Your message cannot be delivered to the following recipients:
>>Recipient address: servi...@theirdomain.com
Reason: Illegal host/domain name found
>>I also used something like this in the script to make it work when
sending it to myself:
>>ini_set('SMTP', 'mail.theirdomain.com');
ini_set('sendmail_from', 'servi...@theirdomain.com');
>>Is it the fact that I send this email in plain text with no headers
that could trigger some sort of spam filtering?
>>If so, what headers should I be using?
>>Thanks in advance

I can't give a lot of detail, but it's because the Headers are
non-RFC compliant, I imagine. Without the envelope "from" and
"return path" etc. many ISPs will reject the mail. I imagine someone
who can give you specific details will be along shortly.

HTH
Well, since no one else has come along yet I'll give you what little I
know from my meager experience:
You have to have From. Not the From that prints for the recipient, but
the From header in the envelope.
I think the Return Path is derived from that.

You need to identify the content type. e.g. texp/plain, etc.

Then the doctype, and etc. etc.. PHPNet and W3 schools both have good
articles on them; I'd do some checking there to get going if this is new
to you. Basically you have a set of requireds and then a set of "if you
wanna" types of headers.

I'm new at this too so getting too specific would be the blind leading
the blind <g>.

HTH

Twayne
Jul 28 '08 #4
You don't have to set headers if you ini is set properly, even though
I've never had to set anything in my ini for my mail scripts. I do now
however format the headers properly... excerpt from ini
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail
-t -i").
;sendmail_path =

What are they using for mail? What OS is php running from? If it's
winders check to see if they have the smtp relay open, if not (more
than likely) have the admin add the server to allow it to relay, I
don't remember where it's at off the top of my head as my server admin
hat has a bit of dust one it.

When using headers use similar to this format $header .= "From:
$webmaster" . "\r\n"; . The last part is important, Google for more
info
Jul 28 '08 #5
The Hajj wrote:
You don't have to set headers if you ini is set properly, even though
I've never had to set anything in my ini for my mail scripts. I do now
however format the headers properly... excerpt from ini
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail
-t -i").
;sendmail_path =

What are they using for mail? What OS is php running from? If it's
winders check to see if they have the smtp relay open, if not (more
than likely) have the admin add the server to allow it to relay, I
don't remember where it's at off the top of my head as my server admin
hat has a bit of dust one it.

When using headers use similar to this format $header .= "From:
$webmaster" . "\r\n"; . The last part is important, Google for more
info
No, you don't HAVE to set headers to send the email. But if you don't
have certain headers, some spam filters will chuck the message.

An example is not having Reply To: - if it's missing or doesn't match
the From: header, it won't make it through some spam filters.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 29 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
4
by: splicemix | last post by:
Hi all, I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time...
6
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
2
by: SharpSmith | last post by:
hi all i have a very specific question regarding emails sending and googling doesn't help me is a way exists to send email using .NET framework (System.Web.Mail or something else) and have the...
8
by: Michel Posseth [MCP] | last post by:
Hi does someone has experience with this ?? i have made a lot of apps in the past that were capable of sending e-mails the server i then talked to was a Linux SMTP server and it worked great ...
8
by: mc | last post by:
I would like to be able to send from an ASP.NET page an email which when recieved takes the form of a "Sharing Invitation for a RSS Feed"...
7
by: undbund | last post by:
Hi I am creating a newsletter system. The software should run from desktop computer (localhost) but be able to send email to anyone on the internet. Can you guys give me some ideas on how to...
5
by: sui | last post by:
this is my code import sys, os, glob, datetime, time import smtplib ## Parameters for SMTP session port=587 SMTPserver= 'smtp.gmail.com' SMTPuser= '...@gmail.com' pw= 'fill in here'...
4
by: dragon52 | last post by:
Hi there, I am writing php to send email containing Chinese text. The chinese displays correctly depending on different mail servers, it seems. I can read the chinese text if I open the email...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.