Jump to content

mail() with attachments


pshankland

Recommended Posts

I have got the following VERY basic script:

[code]<?php
$to = 'somone@somewhere.com';
$subject = 'Some Subject';
$message = 'Some Message';

mail($to, $subject, $message, '', '-fsomeoneelse@domain.com');
?>[/code]

This works but I need to be able to send a *.sql file as an attachment and although there is lots of help on the net I am a bit stuck. Anyone give me a simple addon to this script for me to mail the attachment? I have looked and can't use the phpmailer class as don't have the ability edit the php.ini file on my hosted server.

Also, I would like to have the current date within the subject, how can I do this?

Thanks.
Link to comment
Share on other sites

html mime mail [a href=\"http://www.phpguru.org/static/mime.mail.html\" target=\"_blank\"]http://www.phpguru.org/static/mime.mail.html[/a] download and check out examples I got it to work no problem


[!--quoteo(post=355494:date=Mar 15 2006, 02:53 PM:name=pshankland)--][div class=\'quotetop\']QUOTE(pshankland @ Mar 15 2006, 02:53 PM) [snapback]355494[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I have got the following VERY basic script:

[code]<?php
$to = 'somone@somewhere.com';
$subject = 'Some Subject';
$message = 'Some Message';

mail($to, $subject, $message, '', '-fsomeoneelse@domain.com');
?>[/code]

This works but I need to be able to send a *.sql file as an attachment and although there is lots of help on the net I am a bit stuck. Anyone give me a simple addon to this script for me to mail the attachment? I have looked and can't use the phpmailer class as don't have the ability edit the php.ini file on my hosted server.

Also, I would like to have the current date within the subject, how can I do this?

Thanks.
[/quote]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.