943,704 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 78140
  • PHP RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jun 25th, 2009
0

Re: send email with attachment

use php pear to send email.
its works fine for me.
check these links
http://www.tuxradar.com/practicalphp/15/5/2

http://www.tuxradar.com/practicalphp/15/5/3
Reputation Points: 10
Solved Threads: 7
Junior Poster in Training
danishbacker is offline Offline
97 posts
since Apr 2008
Mar 24th, 2010
0
Re: send email with attachment
Thanks, I did find some useful code, and have fixed it to work to my advantage. Here is the code that is working for me.

[PHP]
<?php
?>
[/PHP]

This code seems to work just fine.
Thanks!
You, sir, are a genius. Thank you for posting your solution. It worked perfectly for me as well. (had to change it because my page has no "post", but that was the easy part! you supplied the working "base" ...)

Thanks to you and all those who helped you generate that code
Reputation Points: 10
Solved Threads: 0
Newbie Poster
williamconley is offline Offline
2 posts
since Mar 2010
May 8th, 2010
0
Re: send email with attachment
I really like this thread, I created something earlier to send emails with attachments in php. It backups a mysql database and then attaches it an email, you can set it up on a cron job to auto send the email everyday! It's a nice bit of code.
If anyone is interested see it here: http://www.thephpanswers.com/viewtop...11&t=8&start=0
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cjensen25 is offline Offline
2 posts
since May 2010
May 8th, 2010
0
Re: send email with attachment
Click to Expand / Collapse  Quote originally posted by cjensen25 ...
I really like this thread, I created something earlier to send emails with attachments in php. It backups a mysql database and then attaches it an email, you can set it up on a cron job to auto send the email everyday! It's a nice bit of code.
If anyone is interested see it here: http://www.thephpanswers.com/viewtop...11&t=8&start=0
consider using scp to copy your backup (securely!) after creating it. you can use authorized keys to pre-auth the user to transfer files and then you can run unattended backups without passing all the data through SMTP.

alternately, you can even create a UUID with php and email that (after creating a link file or saving the backup with the UUID as a filename) so the receiver of the email can directly download the file (but only if they have the UUID, once again it can be secure if you use secure email and https for the file tranfer, and the likelihood of someone "guessing" the filename to download it are ... slim)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
williamconley is offline Offline
2 posts
since Mar 2010
May 8th, 2010
0
Re: send email with attachment
consider using scp to copy your backup (securely!) after creating it. you can use authorized keys to pre-auth the user to transfer files and then you can run unattended backups without passing all the data through SMTP.

alternately, you can even create a UUID with php and email that (after creating a link file or saving the backup with the UUID as a filename) so the receiver of the email can directly download the file (but only if they have the UUID, once again it can be secure if you use secure email and https for the file tranfer, and the likelihood of someone "guessing" the filename to download it are ... slim)
Hi William,

Thanks for the comments they are noted

I have actually created a little cleanup procedure so the .sql in the folder get deleted every time the script is ran. I appreciate your comments about the security. However like you said, the chances are very slim somebody could guess the URL + with the .htaccess the public cannot browse the directory. The whole idea was to have the backup sent automatically, no requirements for the user - so even though the unique identifier idea is good it wouldnt work well in this scenario.

Regards,
Colin Jensen
Reputation Points: 10
Solved Threads: 0
Newbie Poster
cjensen25 is offline Offline
2 posts
since May 2010
Jun 22nd, 2010
0

attachment in mail

File is sending but we are not able to see the content of that file
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vijay_k137 is offline Offline
1 posts
since Jun 2010
Aug 13th, 2010
0
Re: send email with attachment
I just tried it, but it doesn't seem to work, I get the error message back.
Which I think is fine because, how will it send the email if we don't provide it the smtp server and all ?
Please explain.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
LaWFuLEviL is offline Offline
1 posts
since Aug 2010
Aug 19th, 2010
0
Re: send email with attachment
Click to Expand / Collapse  Quote originally posted by adiki ...
i use php code with apache web server . to send mail directly from the script but i'm not able to send my message with images , the problem is i have warrning that is smtp porblem what can i do?

can you publish more information about your problem. normally if you are trying to send an email using php mail() function on windows you must install a MTA (Mail Transport Agent) like xmail. cos windows does not have internal mail server like Linux/UNIX
Last edited by xiles; Aug 19th, 2010 at 2:03 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xiles is offline Offline
4 posts
since Aug 2010
Aug 19th, 2010
0
Re: send email with attachment
Click to Expand / Collapse  Quote originally posted by LaWFuLEviL ...
I just tried it, but it doesn't seem to work, I get the error message back.
Which I think is fine because, how will it send the email if we don't provide it the smtp server and all ?
Please explain.

are you using a linux server or windows.. if you are on windows you must install a MTA(Mail Transport Agent).
Reputation Points: 10
Solved Threads: 0
Newbie Poster
xiles is offline Offline
4 posts
since Aug 2010
Sep 14th, 2010
0

Php mail with attachment

This code seems to be very simple and precise. Thank you very much..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
akilasreeram is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Strip a word from a variable
Next Thread in PHP Forum Timeline: Really need this one!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC