-
July 1st, 2004, 11:04 AM
#16
Makes sense to me, I will test it out.
Thanks for the reply
The most knowledgeable people are those who know that they know nothing.
-
July 1st, 2004, 12:01 PM
#17
Well...and to provide another reason...this is old code, copied and pasted for a long time...maybe it needs a rewrite...
Last edited by Andreas Masur; July 1st, 2004 at 12:04 PM.
-
July 1st, 2004, 12:02 PM
#18
Originally posted by Bond
Maybe because sprintf, like wsprintf (as I found out), has a limit of 1024 characters.
Really? Did not know that....thanks for pointing that out...
-
July 1st, 2004, 02:13 PM
#19
I was guessing that was the case. Turns out it isn't. wsprintf DOES have a 1024 limit. sprintf does not.
Here's a little test:
Code:
#include <windows.h>
#include <stdio.h>
int main()
{
// Create a really large buffer...
char szBuffer[4096] = {0};
// Fill 100 elements with consecutive letters (0-99=A, 100-199=B,..., 2500-2599=Z)...
for (int i = 0; i < 26; i++)
for (int j = 0; j < 100; j++)
szBuffer[i * 100 + j] = 65 + i;
// End the string at the 2600th element...
szBuffer[2600] = 0;
// Display the string...
printf("Original String\n%s\n\n", szBuffer);
// Now, copy the string using sprintf/wsprintf...
char szBuffer2[4096];
wsprintf(szBuffer2, "%s", szBuffer);
// Display the new string...
printf("New String:\n%s\n\n", szBuffer2);
return 0;
}
You'll find that the original string is printed in its entirety. The new string, however, ends at the 24th K.
K = 10th letter...
10 * 100 elements/letter = 1000...
Add the 24...
1024 elements copied into new buffer.
If you change the wsprintf line to use sprintf instead, it works fine.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-
July 2nd, 2004, 10:22 AM
#20
That is possible, but maybe it is to do with memory..
Not really sure
The most knowledgeable people are those who know that they know nothing.
-
July 6th, 2004, 04:21 AM
#21
Andreas,
I could run that code and i m not getting any errors..still it doesnt send any mail..i mean i gave cmd line arguments like this
"sendmail mail.infotechsa.com sushp@infotechsa.com sushp@infotechsa.com message.txt"
this doesnt send mail to abv address...plz tell me some details abt last arguement ..is it a .txt file?if yes,shud i give full path of that file on my computer?or i what else shud i enter there?
plzzzzzz reply.
-
July 8th, 2004, 01:43 PM
#22
Originally posted by sushb4u
this doesnt send mail to abv address...plz tell me some details abt last arguement ..is it a .txt file?if yes,shud i give full path of that file on my computer?or i what else shud i enter there?
plzzzzzz reply.
Well...it sends the mail correctly, however the body is somehow empty...I need to test this further I guess...sorry about that...
-
July 8th, 2004, 02:14 PM
#23
I know this is late, but try this class: http://www.naughter.com/smtp.html
Not only is it well written but very solid.
Tom
Thanks
Tom Wright
-
July 9th, 2004, 01:36 AM
#24
Hi everybody..
all abv programs need name of smtp server...but i have only email address of receipent...so does anybosy know function or api to get smtp server name from given email address??or else can i use any standerd smtp server for any email id?if yes...plz tell me which smtp server i can use.
Thanks
-
July 9th, 2004, 01:51 AM
#25
Normally you would send email through your smtp server for your ISP/email account unless you are trying to hide your email address/identity/IP address. Many ISP's are not accepting email directly from a person to their smtp server unless they have a email account on that server. Many ISP are checking origin of email and if it is not from a registered email server(IP address) it won't relay email or accept the mail. With 80% of email today as spam ISP's are cracking down on people using their resources for someone elses gain.
So just send the email through your ISP's smtp server and all will work just fine.
HTH
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
July 9th, 2004, 02:17 AM
#26
hi...thanz a lot...but i m sorry..i didnt get much..(
what do u mean by
"Normally you would send email through your smtp server for your ISP/email account "
ya i dont want to hide senders email address or identity...but user can enter any email id in from and to fields....so how can i get smtp server for that account's ISP??
-
July 9th, 2004, 02:27 AM
#27
ya i dont want to hide senders email address or identity...but user can enter any email id in from and to fields....so how can i get smtp server for that account's ISP??
If this is the case then you would have the user enter their smtp server address. As with most ISP's today in order to send email through their smtp server you must have a email account and log on with a user id and password this keeps people from using false return email address and using their smtp servers to relay SPAM.
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
July 9th, 2004, 02:38 AM
#28
If this is the case then you would have the user enter their smtp server address.
user's stmp server address means which address?? i mean suppose i m not asking for from id (it is fixed) and i m asking for only "To" address...and user entered "abc@yahoo.com" and suppose my from id is "me@mycomp.com" then i have to use which smtp server? server for input email address or server for mycomp's address?
i m sorry if i m creating some confusion...but plz reply
-
July 9th, 2004, 02:48 AM
#29
"To" address...and user entered "abc@yahoo.com" and suppose my from id is "me@mycomp.com" then i have to use which smtp server? server for input email address or server for mycomp's address?
You would use the smtp server for "me@mycomp.com", you use the smtp server of the senders address.
Jim
ATP BE400 CE500 (C550B-SPW) CE560XL MU300 CFI CFII
"The speed of non working code is irrelevant"... Of course that is just my opinion, I could be wrong.
"Nothing in the world can take the place of persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination are omnipotent. The slogan 'press on' has solved and always will solve the problems of the human race."...Calvin Coolidge 30th President of the USA.
-
July 9th, 2004, 03:44 AM
#30
ok... thanx a lottt my prog is working now.
can i give any points or like something that??i m new to this forum...thats why i m asking this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|