SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot CDitty's Avatar
    Join Date
    Feb 2000
    Location
    Memphis Tn
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone tell me how to use sendmail and file attachments together?

    Thanks

    CDitty

    ------------------
    Stop on by and try to win. Someone has to win. Might as well be you.

    RedHotSweeps.com


  2. #2
    SitePoint Member
    Join Date
    Feb 2000
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    You can send file attatchments in perl using the sendmail by doing this:

    #!/usr/bin/perl
    print "Content-type:text/html\n\n";
    print "message is being sent.";
    open (MAIL, "|/usr/sbin/sendmail -t");
    print MAIL "To: email@domain.com\n";
    print MAIL "From: email2@domain2.com\n";
    print MAIL "Subject: subject\n\n";
    print MAIL "message goes here";
    print MAIL "\n\n";
    $attachment = 'file.zip';
    open(FILE, "uuencode $attachment $attachment|");
    while( <FILE> ) { print MAIL; };
    close(FILE);
    close(MAIL);

    I hope this helps you.

    -Jason Weinstein
    weinstein@sympatico.ca
    http://www.maximumedge.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •