I hate the stupid Net::SMTP subject field doesn't show

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default I hate the stupid Net::SMTP subject field doesn't show

    Everything else works but the subject field doesn't show. Has anyone
    else had the same problem, or maybe got the solution somehow???? Any
    help appreciated...

    $smtp = Net::SMTP->new(mine.your.com);
    $smtp->mail ($mailfrom);
    #the administrator's email goes here
    $smtp->to('mine\@your.com');
    $smtp->data();
    $smtp->datasend("To: mine\@your.com\n");
    $smtp->datasend("\n");
    $smtp->datasend("\n");

    something within these lines should be the answer...
    Almir Guest

  2. Similar Questions and Discussions

    1. SMTP From field using MIME::Lite
      I wrote the following code: MIME::Lite->send('smtp', "mail.myserver.com", Timeout=>60); $msg = MIME::Lite->new( From ...
    2. Email Subject from a Field
      Hi I am using Acrobat Pro 7.0 on a PC. I have a pdf in Designer with a form that users fill out then click on an email submit button and it sends...
    3. Defined text field in form -> subject field in e-mail
      Hi, I have a form on my web site which users send to me by mailto-function. I would like the text they write in a particular text field to...
    4. how to show part of a field?
      I have a web page with messages. I want to show the list of the messages only with part of them, for example the first 30 letters/characters. Now...
    5. Email Subject heading Derived from Form text field Value/s
      Can I create a button on a form which takes the value of a text field (or more then a one text field concatinated together)and then uses this value...
  3. #2

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    When I retrieved my latest USENET messages, I saw that
    [email]almir_7@yahoo.com[/email] (Almir) wrote:
    >Everything else works but the subject field doesn't show. Has anyone
    >else had the same problem, or maybe got the solution somehow???? Any
    >help appreciated...
    >
    >$smtp = Net::SMTP->new(mine.your.com);
    >$smtp->mail ($mailfrom);
    >#the administrator's email goes here
    >$smtp->to('mine\@your.com');
    >$smtp->data();
    >$smtp->datasend("To: mine\@your.com\n");
    >$smtp->datasend("\n");
    >$smtp->datasend("\n");
    >
    >something within these lines should be the answer...
    We use Mail::Sendmail for mailing w/in most of our scripts, and it
    works well--have you tried that?


    Kimberly Murphy-Smith -- [email]kamurphy@ix.netcom.com[/email]
    [url]http://members.aol.com/kimmurphy/[/url]

    Kimberly's Barbie Collection:
    [url]http://members.aol.com/kimmurphy/barbies.html[/url]
    Kimberly Murphy-Smith Guest

  4. #3

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    [email]almir_7@yahoo.com[/email] (Almir) writes:
    > Everything else works but the subject field doesn't show. Has anyone
    > else had the same problem, or maybe got the solution somehow???? Any
    > help appreciated...
    You can add a subject line (or any other header line) anywhere before
    the first blank line. You probably also want to end and quit.
    > $smtp = Net::SMTP->new(mine.your.com);
    > $smtp->mail ($mailfrom);
    > #the administrator's email goes here
    > $smtp->to('mine\@your.com');
    > $smtp->data();
    > $smtp->datasend("To: mine\@your.com\n");
    $smtp->datasend("Subject: $subject\n");
    > $smtp->datasend("\n");
    > $smtp->datasend("\n");
    $smtp->dataend();

    $smtp->quit;

    But wouldn't you rather use something a little higher level, such as
    Mail::Mailer (part of MailTools) or the aforementioned Mail::Sendmail?

    Tim
    Tim Heaney Guest

  5. #4

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    I'm have windows xp as my OS so some of these things wont work as if
    in unix based systems.
    I know that -> $smtp->datasend("Subject: $subject\n"); will insert a
    subject field in the body of a message, but i want it in the header.
    I'm dealing with a variable that needs to be put into subject field,
    it will vary of course from time to time, from email to email. Is
    there a line of code that i could use or alter to use in the script i
    already have Net::SMTP or do i need to look into somethings else. I
    have all the variables parsed so i don't need one of those hashes or
    arrays to parse and send in the body as it would be in the
    header...any ideas??????? thx
    Almir Guest

  6. #5

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    [email]almir_7@yahoo.com[/email] (Almir) said:
    >I'm have windows xp as my OS so some of these things wont work as if
    >in unix based systems.
    >I know that -> $smtp->datasend("Subject: $subject\n"); will insert a
    >subject field in the body of a message, but i want it in the header.
    No, datasend will do headers as well as content.
    Everything up to the first empty line (line with only \n on it)
    are headers, and everything after the first empty line is message body.

    So, if you have
    $smtp->datasend("To: $to_addr\n");
    $smtp->datasend("\n");
    $smtp->datasend("Subject: $subject\n");

    the subject will end up in the message body, but if you do
    $smtp->datasend("To: $to_addr\n");
    $smtp->datasend("Subject: $subject\n");
    $smtp->datasend("\n");

    then the subject line will be a header line.
    --
    Wolf a.k.a. Juha Laiho Espoo, Finland
    (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
    PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
    "...cancel my subscription to the resurrection!" (Jim Morrison)
    Juha Laiho Guest

  7. #6

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    [email]almir_7@yahoo.com[/email] (Almir) writes:
    > I'm have windows xp as my OS so some of these things wont work as if
    > in unix based systems.
    Both Mail::Mailer and Mail::Sendmail work fine in Windows XP.
    > I know that -> $smtp->datasend("Subject: $subject\n"); will insert a
    > subject field in the body of a message, but i want it in the header.
    And using them, with their slightly higher level of abstraction, might
    prevent misunderstandings like this.

    Tim
    Tim Heaney Guest

  8. #7

    Default Re: I hate the stupid Net::SMTP subject field doesn't show

    $smtp->datasend("To: $to_addr\n"); << Take out the \n in this line
    $smtp->datasend("Subject: $subject\n"); << And in this line.
    $smtp->datasend("\n");

    Worked for me.

    Malice
    Malice Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139