how to read email address from a file and send mail??

Discussion in 'C Programming' started by ambs.tech@gmail.com, Feb 1, 2005.

  1. Guest

    Hi all,

    Is there any way to read a email address from a text file and send
    email to that address using C language. any hint or any code regarding
    this will be very helpful.

    Thanks,

    Ambika
     
    , Feb 1, 2005
    #1
    1. Advertising

  2. "" <> writes:
    > Is there any way to read a email address from a text file and send
    > email to that address using C language. any hint or any code regarding
    > this will be very helpful.


    Not portably. The best approach is probably to invoke some external
    program with appropriate arguments; you can use the system() function
    to do this. For details, try a newsgroup specific to your system.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 1, 2005
    #2
    1. Advertising

  3. In article <>,
    <> wrote:
    >Hi all,
    >
    >Is there any way to read a email address from a text file and send
    >email to that address using C language. any hint or any code regarding
    >this will be very helpful.


    Use fopen and fgets to read lines from the file, and examine the buffer
    you're reading into (either by looking at individual characters or
    using the strxxx functions in <string.h>) to see whether you got an
    email address.

    Sending mail requires features not defined by the C standard and is
    therefore beyond the scope of comp.lang.c . There's a good chance there
    are better tools than C for whatever you're trying to do anyways.

    (Unless you're trying to write a massmailing spam program, in which case
    you can get better results just by writing the mail to /dev/null, NUL,
    or something else not entirely unlike these, whichever is supported by
    your OS - aside from that one detail, the entire program can be written
    in portable C.)


    dave
    (maintains a small mailing list with a 5-line shell script)

    --
    Dave Vandervies
    Of course I have other blind spots than this one (conservation of
    ineptitude and all that), but I can't see them.
    --Chris Dollin in comp.lang.c
     
    Dave Vandervies, Feb 1, 2005
    #3
  4. (Dave Vandervies) writes:
    [...]
    > (Unless you're trying to write a massmailing spam program, in which case
    > you can get better results just by writing the mail to /dev/null, NUL,
    > or something else not entirely unlike these, whichever is supported by
    > your OS - aside from that one detail, the entire program can be written
    > in portable C.)


    If you're trying to write a massmailing spam program, and you plan to
    run it only on your own computer, you should write the mail directly
    to the raw disk device. That's a much better use for it than all that
    formatting and directory information.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    We must do something. This is something. Therefore, we must do this.
     
    Keith Thompson, Feb 1, 2005
    #4
  5. Randy Howard Guest

    In article <>,
    says...
    > Hi all,
    >
    > Is there any way to read a email address from a text file and send
    > email to that address using C language. any hint or any code regarding
    > this will be very helpful.


    It can be done with a shell script quite easily, so it is definitely
    doable in C, as long as you don't get too upset over using system()
    for some of the less portable aspects.

    Since it sounds as if you are trying to write an email spam generator
    to get around limits on address list lengths, I doubt that you will
    get much more help here.


    --
    Randy Howard (2reply remove FOOBAR)
     
    Randy Howard, Feb 1, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pauli
    Replies:
    0
    Views:
    350
    pauli
    May 25, 2004
  2. Shaldaman
    Replies:
    7
    Views:
    2,205
    Beauregard T. Shagnasty
    Jun 14, 2006
  3. =?Utf-8?B?dHZpbg==?=

    send email with .net (code) and hotmail(e-mail)

    =?Utf-8?B?dHZpbg==?=, Nov 4, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    662
    sloan
    Nov 5, 2007
  4. Replies:
    4
    Views:
    292
  5. Replies:
    13
    Views:
    525
    Randy Webb
    May 14, 2006
Loading...

Share This Page