php mail script w/attachment

Links for php scripts

Moderators: macek, egami, gesf

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

php mail script w/attachment

Postby startech » 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!

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

Postby swirlee » 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.

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

Postby nathanwebb6 » 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

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

Postby startech » 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.


Return to “PHP Scripts”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest