Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

php mail script w/attachment

Links for php scripts

Moderators: macek, egami, gesf

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!
startech
New php-forum User
New php-forum User
 
Posts: 12
Joined: Mon Jun 30, 2003 10:54 am

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.
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

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
nathanwebb6
New php-forum User
New php-forum User
 
Posts: 27
Joined: Sat Jul 05, 2003 5:08 pm
Location: england uk

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.
startech
New php-forum User
New php-forum User
 
Posts: 12
Joined: Mon Jun 30, 2003 10:54 am


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron