corect way to use mail() function

corect way to use mail() function

am 11.01.2010 23:17:30 von LAMP

--------------060407010406020104000603
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi,
The company I work for, hosts online events registration applications.
After a registered registered himself for an event he will get a
confirmation email saying he registered successfully.
Currently, in the header part of the mail(), in "From" it says e.g.
orders@computility.com - because the email comes from us not from our
client (e.g. ABC Assoc.). Reply-to goes to us too.

Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
field their email, to looks like the email comes from them. something
like: From: ABC Assoc. ;

I refused to do that concerned we are going to be blacklisted for
sending "spam". Because header shows one place and From field says other
email address - spam way of sending emails.

Am I right or it really doesn't matter "who" sent the email?

LL



--------------060407010406020104000603--

RE: corect way to use mail() function

am 11.01.2010 23:58:46 von Daevid Vincent

> -----Original Message-----
> From: LAMP [mailto:lamp@afan.net]
> Sent: Monday, January 11, 2010 2:17 PM
> To: PHP-General List
> Subject: [PHP] corect way to use mail() function
>
> Hi,
> The company I work for, hosts online events registration
> applications.
> After a registered registered himself for an event he will get a
> confirmation email saying he registered successfully.
> Currently, in the header part of the mail(), in "From" it says e.g.
> orders@computility.com - because the email comes from us not from our
> client (e.g. ABC Assoc.). Reply-to goes to us too.
>
> Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
> field their email, to looks like the email comes from them. something
> like: From: ABC Assoc. ;
>
> I refused to do that concerned we are going to be blacklisted for
> sending "spam". Because header shows one place and From field
> says other
> email address - spam way of sending emails.
>
> Am I right or it really doesn't matter "who" sent the email?
>
> LL

I do that sort of thing all the time and don't get RBL'd.

I think the key things are if your domain can be reverse verified, the
frequency you send (if you're just sending hundreds of emails out that's a
red flag), BCC: but no TO:, and if the content/body seems to be non-spammy.
Make sure any hyperlinks in the body are correct and non-spammy looking
too. A common phishing routine is to display one hyperlink to the user, but
the actual 'click' takes you somewhere else. I think doing one of those,
"to register, click _here_" deals is WORSE (from an automated spam filter
POV) than showing the actual hyperlink and making it a hyperlink too. Ala,
"to register, click http://www.abcaccos.org/register/fa4jar4875". Avoid
sending HTML emails for registrations too. It has a better chance of
getting through and should have a disclaimer in it to 'whitelist this
sender' sort of dealio. Once they're setup, then you can work with HTML
emails, but you don't want to loose/frustrate customers right off the bat
by not letting them register properly despite how pretty you think the HTML
version looks.

I think you should
[a] do what your client asks -- it's their money
[b] put in a From: that is representative of the site the user expected the
email to actually come from
[c] put a disclaimer on your web form for the person to add
"orders@computility.com" and "events@abcaccos.org" to their whitelist
(no-spam filter)
[d] make the SUBJ: line of the email VERY explicit about WHO and WHAT this
is concerning:
ie SUBJ: "Registration Confirmation from ABC Assoc. for username JDOE
requested"

If I was a customer and got an email from @computility.com and I didn't
know who the heck they were, since I was expecting from @abcaccos.org, then
I would most likely delete it. I have an itchy trigger finger and tend to
delete first, ask questions later. ;-)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: corect way to use mail() function

am 12.01.2010 05:51:25 von Paul M Foster

On Mon, Jan 11, 2010 at 04:17:30PM -0600, LAMP wrote:

> Hi,
> The company I work for, hosts online events registration applications.
> After a registered registered himself for an event he will get a
> confirmation email saying he registered successfully.
> Currently, in the header part of the mail(), in "From" it says e.g.
> orders@computility.com - because the email comes from us not from our
> client (e.g. ABC Assoc.). Reply-to goes to us too.
>
> Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
> field their email, to looks like the email comes from them. something
> like: From: ABC Assoc. ;
>
> I refused to do that concerned we are going to be blacklisted for
> sending "spam". Because header shows one place and From field says other
> email address - spam way of sending emails.
>
> Am I right or it really doesn't matter "who" sent the email?

Since the mail() function doesn't have a parameter for the "From:", how
do you force it to be a certain thing in the first place?

Paul

--
Paul M. Foster

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: corect way to use mail() function

am 12.01.2010 05:53:15 von Daevid Vincent

=20

> -----Original Message-----
> From: Paul M Foster [mailto:paulf@quillandmouse.com]=20
> Sent: Monday, January 11, 2010 8:51 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] corect way to use mail() function
>=20
> On Mon, Jan 11, 2010 at 04:17:30PM -0600, LAMP wrote:
>=20
> > Hi,
> > The company I work for, hosts online events registration=20
> applications.
> > After a registered registered himself for an event he will get a
> > confirmation email saying he registered successfully.
> > Currently, in the header part of the mail(), in "From" it says e.g.
> > orders@computility.com - because the email comes from us=20
> not from our
> > client (e.g. ABC Assoc.). Reply-to goes to us too.
> >
> > Now one of our clients (e.g. ABC Assoc.) asks us to put in=20
> the "from"
> > field their email, to looks like the email comes from them.=20
> something
> > like: From: ABC Assoc. ;
> >
> > I refused to do that concerned we are going to be blacklisted for
> > sending "spam". Because header shows one place and From=20
> field says other
> > email address - spam way of sending emails.
> >
> > Am I right or it really doesn't matter "who" sent the email?
>=20
> Since the mail() function doesn't have a parameter for the=20
> "From:", how
> do you force it to be a certain thing in the first place?
>=20
> Paul

That's what the headers are for son! :)

/**
* This is the actual 'engine' that does the sending of an SMS or
Email.
*
* @access static final
* @return void
* @param string $to the email address to send to
* @param string $subject the subject line of the message
* @param string $body the body of the message
* @param boolean $html use 'html' (true) or 'plain' (false)
* @author Daevid Vincent [daevid.vincent@panasonic.aero]
* @date 12/22/09
* @see send_email()
*/
static final function email($to, $subject, $body, $html=3Dtrue)
{
$headers =3D "MIME-Version: 1.0\r\n";
$headers .=3D "Content-type: text/".( ($html) ? 'html' :
'plain')."; charset=3Diso-8859-1\r\n";
$headers .=3D "From: ".COMPANY_FULL_NAME.' '.PRODUCT_NAME."
<".PRODUCT_SUPPORT_EMAIL.">\n";
//$headers .=3D "Cc: Daevid Vincent
\r\n";
//$headers .=3D "Bcc: president@example.com\r\n";
//$headers .=3D "Reply-To: ".$myname."
<".$myreplyemail.">\r\n";
$headers .=3D "X-Priority: 1\r\n";
$headers .=3D "X-MSMail-Priority: High\r\n";
$headers .=3D "X-Mailer: ".COMPANY_FULL_NAME." Linux Server";

$body .=3D "

\n\nThis is an automated email from host
(".$_SERVER['SERVER_NAME'].") ".$_SERVER['SERVER_ADDR'].". Do not reply =
to
it.
";
if (!$html) $body =3D strip_tags($body);

mail($to, $subject, $body, $headers);
}


/**
* Send this user an HTML email.
*
* @access public
* @return boolean
* @author Daevid Vincent [daevid.vincent@panasonic.aero]
* @date 12/22/09
* @see User::email()
*/
public function send_email($subject, $body)
{
$to =3D $this->get_fullname().' <'.$this->email.'>';
User::email($to, $subject, $body,
(strtolower($this->emailformat) == 'html') );
add_user_log('Action', 'Email \''.$subject.'\' sent');
}


ÐÆ5ÏÐ=20
http://daevid.com

There are only 11 types of people in this world. Those that think binary
jokes are funny, those that don't, and those that don't know binary.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: corect way to use mail() function

am 12.01.2010 06:08:30 von Angus Mann

There are only 11 types of people in this world. Those that think binary
jokes are funny, those that don't, and those that don't know binary.

Er....Ummm.....shouldn't that read "...only 10 types of people..." ?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: corect way to use mail() function

am 12.01.2010 11:45:43 von Michael Peters

Angus Mann wrote:
> There are only 11 types of people in this world. Those that think binary
> jokes are funny, those that don't, and those that don't know binary.
>
> Er....Ummm.....shouldn't that read "...only 10 types of people..." ?
>
>
>

1 - those that think they are funny
10 - those that don't
11 - those that don't know binary

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: corect way to use mail() function

am 12.01.2010 12:41:21 von Skylinux

> LAMP wrote:
> Hi,
> The company I work for, hosts online events registration applications.
> After a registered registered himself for an event he will get a
> confirmation email saying he registered successfully.
> Currently, in the header part of the mail(), in "From" it says e.g.
> orders@computility.com - because the email comes from us not from our
> client (e.g. ABC Assoc.). Reply-to goes to us too.
> Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"
> field their email, to looks like the email comes from them. something
> like: From: ABC Assoc. ;
> I refused to do that concerned we are going to be blacklisted for
> sending "spam". Because header shows one place and From field says other
> email address - spam way of sending emails.
> Am I right or it really doesn't matter "who" sent the email?


AFAIK, it depends.
If your server is computility.com and your client wants your server to
send email for abcaccos.org.
Then the messages may get flagged as spam if abcaccos.org has a SPF
record excluding your server from sending emails for them.
Some receiving servers will also check back with the sending server if
the email account you are sending from actually exists on the server
(events@abcaccos.org would have to be a valid account on
mail.computility.com).

I don't think that you will get blacklisted for doing this but the
emails may be flagged as SPAM more often.

--
John
"There's something wrong with you if can make make an MMO about Star
Wars, and manage to make nobody want to play it."


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: corect way to use mail() function

am 12.01.2010 14:21:10 von Bob McConnell

From: LAMP

> Hi,
> The company I work for, hosts online events registration applications.

> After a registered registered himself for an event he will get a=20
> confirmation email saying he registered successfully.
> Currently, in the header part of the mail(), in "From" it says e.g.=20
> orders@computility.com - because the email comes from us not from our=20
> client (e.g. ABC Assoc.). Reply-to goes to us too.
>=20
> Now one of our clients (e.g. ABC Assoc.) asks us to put in the "from"=20
> field their email, to looks like the email comes from them. something=20
> like: From: ABC Assoc. ;
>=20
> I refused to do that concerned we are going to be blacklisted for=20
> sending "spam". Because header shows one place and From field says
other=20
> email address - spam way of sending emails.
>=20
> Am I right or it really doesn't matter "who" sent the email?

I believe the correct way to do this is to use the Sender: header for
orders@computility.com to show where it actually came from. Then it
doesn't matter what you put in From.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: corect way to use mail() function

am 12.01.2010 15:57:21 von Michael Peters

Bob McConnell wrote:

>
> I believe the correct way to do this is to use the Sender: header for
> orders@computility.com to show where it actually came from. Then it
> doesn't matter what you put in From.
>
> Bob McConnell
>

I believe that is correct.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: 11 types of people in the world...

am 12.01.2010 21:27:58 von Daevid Vincent

> -----Original Message-----
> From: Michael A. Peters [mailto:mpeters@mac.com]
> Sent: Tuesday, January 12, 2010 2:46 AM
> To: Angus Mann
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] corect way to use mail() function
>
> Angus Mann wrote:
> > There are only 11 types of people in this world. Those that
> > think binary jokes are funny, those that don't,
> > and those that don't know binary.
> >
> > Er....Ummm.....shouldn't that read "...only 10 types of people..." ?
> >
> >
> >
>
> 1 - those that think they are funny
> 10 - those that don't
> 11 - those that don't know binary

LOL.

Thanks Angus Mann for literally being the butt of my joke. :)

Thanks Michael for validating my point. :)

-D-


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: 11 types of people in the world...

am 12.01.2010 21:52:18 von Robert Cummings

Daevid Vincent wrote:
>> -----Original Message-----
>> From: Michael A. Peters [mailto:mpeters@mac.com]
>> Sent: Tuesday, January 12, 2010 2:46 AM
>> To: Angus Mann
>> Cc: php-general@lists.php.net
>> Subject: Re: [PHP] corect way to use mail() function
>>
>> Angus Mann wrote:
>>> There are only 11 types of people in this world. Those that
>>> think binary jokes are funny, those that don't,
>>> and those that don't know binary.
>>>
>>> Er....Ummm.....shouldn't that read "...only 10 types of people..." ?
>>>
>>>
>>>
>> 1 - those that think they are funny
>> 10 - those that don't
>> 11 - those that don't know binary
>
> LOL.
>
> Thanks Angus Mann for literally being the butt of my joke. :)
>
> Thanks Michael for validating my point. :)

Shouldn't the enumeration start at 0 with a default value for said ID?
Perhaps the following:

0 - those that suck the life out of humour
1 - those that think they are funny
10 - those that don't
11 - those that don't know binary

;)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php