php mail script w/attachment

Links for php scripts

Moderators: egami, macek, gesf

Post Reply
startech
New php-forum User
New php-forum User
Posts: 12
Joined: Mon Jun 30, 2003 10:54 am

Tue Jul 15, 2003 8:49 am

Hi,

I am trying to create a mail script that will also send an attachment. The code i have so far goes as follows...

// Mail form starts here

$to = "$email_addr";
$subject = "Your Hosting Information - $domain";
$body = "some message";

if (mail($to, $subject, $body))
{
echo("<p>Message sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
?>

What code could I add to add an attachment?

Any help would be great!
Ok bye,

Startech

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Tue Jul 15, 2003 10:07 am

Try this tutorial, or, if you want to avoid reinventing the wheel, just use someone else's mail script, like LibMail, which makes it pretty damn easy.
Image

nathanwebb6
New php-forum User
New php-forum User
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk
Contact:

Tue Jul 15, 2003 2:24 pm

you could just put a link to a file on ur site, or a image linking 2 ure site etc ... :S much easier
naya

startech
New php-forum User
New php-forum User
Posts: 12
Joined: Mon Jun 30, 2003 10:54 am

Wed Jul 16, 2003 5:00 am

Hi nathanwebb6!.

Thanks for the idea, however it is important that the attachment is sent via this email i wish to send out.
Ok bye,

Startech

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests