Jump to content

Archived

This topic is now archived and is closed to further replies.

pshankland

mail() with attachments

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.

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites
[code]<?php
$date = date("d m Y");
print $date;
?>[/code]

Share this post


Link to post
Share on other sites

×

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.