Results 1 to 2 of 2

Thread: [1.0/1.1] Smtp Mail Attachments

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 2005
    Location
    Colorado
    Posts
    592

    [1.0/1.1] Smtp Mail Attachments

    I'm trying to send an attachment using smtp. I have been successful in sending emails without attachments but every thing I have tried when using the MailAttachment object results in Invalid Attachment.

    I know the attachment exists and that I have access to the file. I have tried both MailEncoding's but with the same result.

    Any ideas?

    Code:
    MailMessage mailMessage = new MailMessage();
    mailMessage.Attachments.Add( new MailAttachment(temp, MailEncoding.UUEncode));
    mailMessage.From = txtTo.Text
    mailMessage.To = txtEmail.Text;
    mailMessage.Subject = "Attachment"
    mailMessage.Body = "Attachment Test";
    
    SmtpMail.Server = "localhost";
    SmtpMail.Send(mailMessage);
    Last edited by Jumpercables; Oct 25th, 2007 at 10:32 AM.

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

Posting Permissions

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



Click Here to Expand Forum to Full Width