pshankland Posted March 15, 2006 Share Posted March 15, 2006 I have got the following VERY basic script:[code]<?php$to = '[email protected]';$subject = 'Some Subject';$message = 'Some Message';mail($to, $subject, $message, '', '[email protected]');?>[/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 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 = '[email protected]';$subject = 'Some Subject';$message = 'Some Message';mail($to, $subject, $message, '', '[email protected]');?>[/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/#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] 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 :) Link to comment https://forums.phpfreaks.com/topic/5069-mail-with-attachments/#findComment-18087 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.