Re: [PHP] corect way to use mail() function
Bob McConnell wrote: I believe the correct way to do this is to use the Sender: header for ord...@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: [PHP] corect way to use mail() function
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 > confirmation email saying he registered successfully. > Currently, in the header part of the mail(), in "From" it says e.g. > ord...@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? I believe the correct way to do this is to use the Sender: header for ord...@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: [PHP] corect way to use mail() function
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. ord...@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 (eve...@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: [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. ErUmmm.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: [PHP] corect way to use mail() function
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. ErUmmm.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: [PHP] corect way to use mail() function
> -Original Message- > From: Paul M Foster [mailto:pa...@quillandmouse.com] > Sent: Monday, January 11, 2010 8:51 PM > To: php-general@lists.php.net > Subject: Re: [PHP] corect way to use mail() function > > 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. > > ord...@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 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.vinc...@panasonic.aero] * @date12/22/09 * @see send_email() */ static final function email($to, $subject, $body, $html=true) { $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/".( ($html) ? 'html' : 'plain')."; charset=iso-8859-1\r\n"; $headers .= "From: ".COMPANY_FULL_NAME.' '.PRODUCT_NAME." <".PRODUCT_SUPPORT_EMAIL.">\n"; //$headers .= "Cc: Daevid Vincent \r\n"; //$headers .= "Bcc: presid...@example.com\r\n"; //$headers .= "Reply-To: ".$myname." <".$myreplyemail.">\r\n"; $headers .= "X-Priority: 1\r\n"; $headers .= "X-MSMail-Priority: High\r\n"; $headers .= "X-Mailer: ".COMPANY_FULL_NAME." Linux Server"; $body .= "\n\nThis is an automated email from host (".$_SERVER['SERVER_NAME'].") ".$_SERVER['SERVER_ADDR'].". Do not reply to it."; if (!$html) $body = strip_tags($body); mail($to, $subject, $body, $headers); } /** * Send this user an HTML email. * * @access public * @return boolean * @author Daevid Vincent [daevid.vinc...@panasonic.aero] * @date12/22/09 * @see User::email() */ public function send_email($subject, $body) { $to = $this->get_fullname().' <'.$this->email.'>'; User::email($to, $subject, $body, (strtolower($this->emailformat) == 'html') ); add_user_log('Action', 'Email \''.$subject.'\' sent'); } ÐÆ5ÏÐ 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: [PHP] corect way to use mail() function
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. > ord...@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: [PHP] corect way to use mail() function
> -Original Message- > From: LAMP [mailto:l...@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. > ord...@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 "ord...@computility.com" and "eve...@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