473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

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

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

Nov 14 '05 #1
4 2137
"am*******@gmail.com" <am*******@gmail.com> 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) ks***@mib.org <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.
Nov 14 '05 #2
In article <11**********************@z14g2000cwz.googlegroups .com>,
am*******@gmail.com <am*******@gmail.com> 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 dj******@csclub.uwaterloo.ca
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
Nov 14 '05 #3
dj******@csclub.uwaterloo.ca (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) ks***@mib.org <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.
Nov 14 '05 #4
In article <11**********************@z14g2000cwz.googlegroups .com>,
am*******@gmail.com 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)
Nov 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Chuck Anderson | last post by:
Can anyone point me in the right direction? I want to use Php to automate confirmation of someone joining an email list by them replying to an email (so they don't have to have a browser?). I...
0
by: Majordomo | last post by:
-- >>>> --36742377 **** Command '--36742377' not recognized. >>>> Content-Type: text/plain; charset=us-ascii **** Command 'content-type:' not recognized. >>>> Content-Transfer-Encoding: 7bit...
2
by: dmiller23462 | last post by:
I would like to append to a file, AS WELL AS, send an email via ASP....I have some sample code from ASP101.com and am planning on modifying it to my uses but I don't know where exactly I should...
4
by: dmiller23462 | last post by:
So here's my problem.....I need to set up different email distributions based on which option in the following Select form has been chosen....For instance if "Putaway" is chosen it needs to email...
2
by: Ron | last post by:
hi guys, I am trying to send email using smtpMail. I can send emails inside the organization, but out of the organization I get an error "The server rejected one or more recipient addresses. The...
5
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
8
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
2
by: kennykenn | last post by:
Hi, Ive producd code to send an email after capturing info off a form,it works fine locally but when i put it live it doesnt work! the code is stopin at 'msg.send' any ideas, here the code! ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.