473,386 Members | 1,715 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.

what is wrong with this mail script

$msubject = "Price Change";
$tomail = "yoelg...@yahoo.com";
$mfrom = "From: Baltimore Trails <i...@baltimoretrails.com>\r\n";
$mbody = "text....asdfasdfasdfasdfasdfa*sdf";
$bcchead1 = "Bcc: i...@baltimoretrails.com\r\n";
$bcchead2 = "Bcc: yoelg...@baltimoretrails.com\r\n";
$header = "$mfrom $bcchead1 $bcchead2";
mail($tomail, $msubject, $mbody, $header);
-------------------------------------------------------

this is what yoelg...@baltimoretrails.com email looks like:
the From field in MS outlook = "Baltimore Trails Bcc:
yoelg...@baltimoretrails.com"
and the To: field = "yoelg...@yahoo.com"
how do I make that the email in the bcc field should not see the To
field, they should see there email in the to field?
and why is the from field the way it is?
As far as the email for yoelg...@yahoo.com everything seems to be fine
with that

Aug 31 '05 #1
4 1344
"yo******@yahoo.com" <yo******@yahoo.com> wrote in
news:11**********************@g14g2000cwa.googlegr oups.com (in part):
$msubject = "Price Change";
$tomail = "yoelg...@yahoo.com";
$mfrom = "From: Baltimore Trails <i...@baltimoretrails.com>\r\n";
$mbody = "text....asdfasdfasdfasdfasdfa*sdf";
$bcchead1 = "Bcc: i...@baltimoretrails.com\r\n";
$bcchead2 = "Bcc: yoelg...@baltimoretrails.com\r\n";
$header = "$mfrom $bcchead1 $bcchead2";
mail($tomail, $msubject, $mbody, $header);
-------------------------------------------------------

this is what yoelg...@baltimoretrails.com email looks like:
the From field in MS outlook = "Baltimore Trails Bcc:
yoelg...@baltimoretrails.com"
and the To: field = "yoelg...@yahoo.com"


Try this instead:

msubject = 'Price Change';
$tomail = 'yoelg...@yahoo.com';
$mfrom = 'From: Baltimore Trails <i...@baltimoretrails.com>'."\r\n";
$mbody = "text....asdfasdfasdfasdfasdfa*sdf";
$header = $mfrom;
$header .= 'Bcc: i...@baltimoretrails.com';
$header .= ',yoelg...@baltimoretrails.com'."\r\n";

Your original way of creating the header put spaces in the string which
probably messed up the email headers. Also, the addresses in the BCC
header should be separated with commas.

Ken
Aug 31 '05 #2
*** yo******@yahoo.com wrote/escribió (31 Aug 2005 14:18:55 -0700):
$mfrom = "From: Baltimore Trails <i...@baltimoretrails.com>\r\n";
$mbody = "text....asdfasdfasdfasdfasdfa*sdf";
$bcchead1 = "Bcc: i...@baltimoretrails.com\r\n";
$bcchead2 = "Bcc: yoelg...@baltimoretrails.com\r\n";
$header = "$mfrom $bcchead1 $bcchead2";


This code creates these headers:

From: Baltimore Trails <i...@baltimoretrails.com>
Bcc: i...@baltimoretrails.com
Bcc: yoelg...@baltimoretrails.com

If first char in line is a white space, mail server will think it's not a
new header but the previous one continued. Remove unwanted spaces.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Sep 1 '05 #3
thank you Ken and Alvaro for your replys

another question. when i ran the script by typing the php file address
in to Internet Explorer, it only sent out like 56 out of about 68
emails. it came back with a 30 second time out error. sorry i dont
remember the exact error message. any idea what and how to correct this

thank you

Sep 13 '05 #4
On 13 Sep 2005 14:15:08 -0700, "yo******@yahoo.com" <yo******@yahoo.com> wrote:
another question. when i ran the script by typing the php file address
in to Internet Explorer, it only sent out like 56 out of about 68
emails. it came back with a 30 second time out error. sorry i dont
remember the exact error message. any idea what and how to correct this


Sent less in a batch, tune your mail server, or increase the PHP execution
time limit http://uk2.php.net/set_time_limit

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 13 '05 #5

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

Similar topics

2
by: johnny | last post by:
hi all, I have a script to send newsletters both in html and text version, all works fine in email clients but unfortunately not in yahoo mail: it shows nothing in the body of the message,...
9
by: Jofio | last post by:
I am just learning PHP. I just tried coding a php script which I saved as mail.php ---------------------------- <? $name=$_POST; $email=$_POST; $comments=$_POST;
4
by: Andre | last post by:
Hi guys, newbie question. I am having trouble with a script that is supposed to login me to my account on yahoo pop server. When i do this: import getpass, poplib, re POPHOST =...
7
by: Tim Gaunt | last post by:
Hi, I'm hoping that someone will be able to help me with this one, I'm developing an application which basically inserts a load of data into the database ready for validation at a later date, I...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
3
by: Andrew | last post by:
Hi, friends, I have a function which send email with attachments as the follows: public int SendEmailWithAttachment(string fromEmailAddress, string toEmailAddress, string subject, string...
5
by: Jim Mitchell | last post by:
I saw several posts asking for popups from web controls. The standard answer is that once rendered, the server no longer has control. I had some success with the following and I was curious if I...
9
by: happyse27 | last post by:
Hi All, In perl script(item b below) where we check if html registration form are filled in properly without blank with the necessary fields, how to prompt users that the field are incomplete...
5
by: Shalini Bhalla | last post by:
hi , A strange error is coming , when i run a php file , all the php and java script executes before submit only which actually should execute after clicking on submit button and...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.