/    Sign up×
Community /Pin to ProfileBookmark

Email Broadcast with Attachment

hi
i am developing a web page in which there is i have to broadcast some emails to some particular email-ids.
in that, i want to attach a file (of any type such as a picture or a doc file or anything) as an [B]attachment [/B] into my web page
how can i do that???
got any ideas
this is my php code for email-broadcast
——————————-CODE————————————–
<?

$emailid = $_SESSION[’emailids’];
$subject= $_
SESSION[‘subject’];
$message = $_SESSION[‘message’];

$from = “some_admin_id”;

echo “Mail have been sent to following addresses…”;

//$count=count($emailid);

foreach($emailid as $id)
{
$headers = ‘From:’. $from . “rn”;
$headers .= ‘MIME-Version: 1.0’ . “rn”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “rn”;

if(!mail($emailid,$subject,$message,$headers))
echo “Failure”;
else
echo “<center><b>$emailid</b></center> “;

}

?>
————————————————————————–

-ashish

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ashishrathoreauthorMar 23.2006 — thanks NogDog

its working but there seems to be a problem with attacment

suppose when i am attaching the file with line as " $mail->AddAttachment("/somedir/somefile.someEXTn") " then it is taking it and sending d email as an attachment

while when i am passing a url of any attachment to this page from some previous page then its not taking the attachment(only mail body is sent)

i think this might be the cause " when i am echoing the path of that attacment in the processing page then it gives something like this --"C:Documents and SettingsAdministratorDesktopcert.gif "

see the '' thing . i think this is giving the problem

what do u think??

also should i have to upload that attachment to the server b4 sending mail or it will take the atttachment from the ocal file system ---plz answer this confusion

thanks

-ashish
Copy linkTweet thisAlerts:
@NogDogMar 23.2006 — You'll definitely need to upload the attachment file to the web server.
×

Success!

Help @ashishrathore spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...