Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: * H E L P M E ....! (URGENT)  (Read 3368 times)

0 Members and 1 Guest are viewing this topic.

dhananjay

    Topic Starter


    Starter

    * H E L P M E ....! (URGENT)
    « on: September 19, 2008, 12:20:32 AM »
    Hi guys,

                it is working perfectly in c#. When I execute this code on site then I'm facing problem regarging attachment.
    using system.web.mail;
               MailMessage mail = new MailMessage();
                mail.From = "[email protected]";     
                mail.To = "[email protected]";
                mail.Subject = "Urgent Subject";   
                mail.Body = "dear,...";
                SmtpMail.SmtpServer = "localhost";
                MailAttachment attach = new MailAttachment("C:\\TEST.TXT");
                 mail.Attachments.Add(attach);
               
                SmtpMail.Send(mail);

    OUT  PUT  : INVALID ATTACHMENT  "C:\TEST.TXT'
    « Last Edit: September 19, 2008, 12:43:39 AM by dhananjay »

    Chrisxs5



      Hopeful
    • Sup!?
    • Thanked: 8
      • Where we learn IT daily!
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 8
    Re: * H E L P M E ....! (URGENT)
    « Reply #1 on: September 19, 2008, 08:34:13 AM »
    You have

    ("C:\\TEST.TXT")

    have you tried

    ("C:\TEST.TXT")

    PS: You may want to change your Subject to something that actually describes your post)
    Check out my blog: http://vitrookie.com

    System, Network, Virtualization, Storage, ETC Admin with a bunch of certs and an ego trip!

    Dias de verano

    • Guest
    Re: * H E L P M E ....! (URGENT)
    « Reply #2 on: September 27, 2008, 06:36:06 AM »
    Read 106 times, answered once. Twice now.  :)

    kpac

    • Web moderator


    • Hacker

    • kpac®
    • Thanked: 184
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 7
    Re: * H E L P M E ....! (URGENT)
    « Reply #3 on: September 28, 2008, 03:22:56 AM »
    Do you not need a username and password to send mail?
    You could be sending the email from any address you want...  ???

    Have you tried PHP?

    "mailform.php"....

    Code: [Select]
    <html>
    <body>

    <?php
    if (isset($_REQUEST['email']))
    //if "email" is filled out, send email
      
    {
      
    //send email
      
    $email $_REQUEST['email'] ; 
      
    $subject $_REQUEST['subject'] ;
      
    $message $_REQUEST['message'] ;
      
    mail"[email protected]""Subject: $subject",
      
    $message"From: $email);
      echo 
    "Thank you for using our mail form.";
      }
    else
    //if "email" is not filled out, display the form
      
    {
      echo 
    "<form method='post' action='mailform.php'>
      Email: <input name='email' type='text' /><br />
      Subject: <input name='subject' type='text' /><br />
      Message:<br />
      <textarea name='message' rows='15' cols='40'>
      </textarea><br />
      <input type='submit' />
      </form>"
    ;
      }
    ?>


    </body>
    </html>