VERY URGENT...............

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

VERY URGENT...............

Post by madhu »

Dear All,

Am reading some mailid's from a text file and am storing in a variable.

$test=a@gmail.com b@yahoo.co.in c@yahoo.co.in d@gmail.com

Now my problem is i want those mailid's in the form of comma (,) seperated mailid's.

i.e,

$test=a@gmail.com, b@yahoo.co.in, c@yahoo.co.in, d@gmail.com

Its very urgent.

Please suggest me ..........

Thanks and regards
MADHU
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You could show us what you've tried already...
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

How exactly they are stored in the file?
You may want to check file().

P.S Don't use the word "urgent" in your post/title since people will automatically skip to the next post. This is the first time I reply to a post with the word "urgent" in its title.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Urgent? :? That's probably the worst way to gather interest for useful responses. For example; I've only open the thread to skim through in case it really was urgent only to now find myself acting as thread title critic.
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post by madhu »

patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Dear All,

Am really sorry.

Please excuse me.

Here is my code.

Code: Select all

$filename = "bcc/" . $_FILES['bccpath']['name'];   //contains all mailid's
        $fp=fopen($filename,"rb");
        if($fp)
          {
            while (!feof($fp))
                 {
                  $bccemails=fgets($fp, 4096);
                  $bccemails=$bccemails.',';   // it contains all mailid's with ',' seperated.
                 }
          }[/b]

Now am trying to send that $bccemails as Bcc. But how to add that word as $bccemails "Bcc" to the mail function.


        [b]if(mail($toid , $subject, $message, $bccemails))
                    {
                     echo "<html><body>";
                     print "success.............";
                     echo ("</body></html>");
                    }[/b]
Waiting for your valuable replies..............

Thanks and regards
MADHU


patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
jito
Forum Commoner
Posts: 85
Joined: Sat Mar 25, 2006 4:32 am
Location: india

Post by jito »

check the extra header section:
http://in.php.net/function.mail
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Code: Select all

explode(', ', $emails); // string to array
implode(', ', $emails); // array to string
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post by madhu »

patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi all ,

Finally after struggling i got some output.

But again i have some problem.

Please check my code.........

Code: Select all

$filename = "bcc/" . $_FILES['bccpath']['name'];
$fp=fopen($filename,"rb");           //to open the file
        $bccemails=file($filename);   //to get as an array
        foreach($bccemails as $bccemail)  
             {
             $headers.= "$bccemail" . ", ";      //',' separated
             }
          $headers = "Bcc: $headers\r\n";     
          if(mail($toid , $subject, $message, $from.$headers))   // to send mail as Bcc
          {
           echo "success.............";
          }

Now problem is mail is not going to the mailid's which are in Bcc.

I think i did some small mistake.

Please check and help me.........

Waiting for your positive replies..........

Thanks and regards
MADHU


patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Code: Select all

if ($phpTags == FORM_GOOD)
if ($noPhpTags == FORM_BAD)

use

Code: Select all

tags
Last edited by Ollie Saunders on Tue Oct 10, 2006 9:06 am, edited 3 times in total.
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post by madhu »

The Bcc mailid's are printing along with the Message........................

Please help me.........

Thanks and Regards
MADHU[/i]
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

madhu, please use

Code: Select all

tags (or other relevant tags such as

Code: Select all

etc.) as explained here (click)[/url].
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post by madhu »

patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi all,

Am sorry , because am in urgent , so i posted that code without keeping the php tags.

Here is my code with PHP tags. 

Please check..............

Code: Select all

<?php 

$filename = "bcc/" . $_FILES['bccpath']['name']; 

$fp=fopen($filename,"rb");           //to open the file 

        $bccemails=file($filename);   //to get as an array 

        foreach($bccemails as $bccemail)  
             { 
             $headers.= "$bccemail" . ", ";      //',' separated 
             } 

          $headers = "Bcc: $headers\r\n";    
  
          if(mail($toid , $subject, $message, $from.$headers))   // to send mail as Bcc 
          { 
           echo "success............."; 
          } 

?>

Kindly please do the needful..........

Waiting for your positive replies...........

Thanks and regards
MADHU


patrikG | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Mahdu, consider this an official warning: either you use PHP-tags when you post here, or your posting rights might be temporarily suspended.

Think about it this way: you are asking others to help you. The least you can do is ensure that you are doing everything you can to make it as easy as possible for them.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

patrikG: he thinks we mean <?php tags.

We mean bbCode

Code: Select all

tags, madhu.
Post Reply