pshankland Posted March 15, 2006 Share Posted March 15, 2006 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 https://forums.phpfreaks.com/topic/5069-mail-with-attachments/ Share on other sites More sharing options...
dootch Posted March 15, 2006 Share Posted March 15, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/5069-mail-with-attachments/#findComment-17965 Share on other sites More sharing options...
keeB Posted March 16, 2006 Share Posted March 16, 2006 [code]<?php $date = date("d m Y");print $date;?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5069-mail-with-attachments/#findComment-17993 Share on other sites More sharing options...
pshankland Posted March 16, 2006 Author Share Posted March 16, 2006 Thanks for the help both,will try out now :) Quote Link to comment https://forums.phpfreaks.com/topic/5069-mail-with-attachments/#findComment-18087 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.