16,008,010 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by ansh_kumar (Top 23 by date)
ansh_kumar
20-Dec-16 8:22am
View
Put a scanf before `strcpy(fileBuf[len++],"To: " TO "\r\n");` now merge the two strings.
ansh_kumar
20-Dec-16 2:43am
View
Of course you can. Just change the code accordingly.
ansh_kumar
19-Dec-16 7:21am
View
Don't include it. It no longer exists.
ansh_kumar
27-May-15 23:08pm
View
The base64 method you are using is same as in solution 2. Moreover the no_of_rows in for loop in read_file is calculated before encoding the file whereas it has to be calculated after encoding the file so that all the encoded text is placed in fileBuf. See solution 3 how it is calculated after encoding the file. I think you were lucky with your file chosen.
ansh_kumar
22-May-15 0:33am
View
Is the code working when you compile it as release version??
ansh_kumar
30-Mar-15 3:50am
View
What's your email address?
ansh_kumar
4-Feb-15 3:10am
View
I've already provided the link to the official website. The website contains source code and instructions.
ansh_kumar
4-Feb-15 2:08am
View
You are using the wrong code.
For sending the image file use the code above it, which uses Imagemagick++.
ansh_kumar
3-Feb-15 8:36am
View
Deleted
anshgravity@gmail.com
ansh_kumar
3-Feb-15 2:01am
View
Can you give me the file you are trying to send ?
ansh_kumar
22-Nov-14 3:42am
View
I changed the code to send jpeg file. See my next solution below.
ansh_kumar
21-Nov-14 9:03am
View
Actually this code is for sending text file only but I can modify it to send JPG file. Wait till tomorrow, I'll be coming with a solution. :)
ansh_kumar
21-Nov-14 0:39am
View
Can you tell me the size of the file you are trying to send perhaps send me the image file you are trying to email.
ansh_kumar
5-Feb-14 3:07am
View
Yes you were right buffer was overrunning, I've corrected it.
ansh_kumar
4-Feb-14 23:31pm
View
Deleted
yes there was a memory leak. I corrected that.
In the line
strcpy(fileBuf[len++],"To: " TO "\r\n");
I added
printf("TO: %d\n",strlen(fileBuf[len]));
and I'm getting
TO: 7616
which is not as expected.
Any guess ??
ansh_kumar
4-Feb-14 7:10am
View
Thats what I'm searching, but no result till now...
In debug version it's only 31 (I guess)...
ansh_kumar
4-Feb-14 6:28am
View
Wait I'm editing the question.
ansh_kumar
25-Jan-14 11:35am
View
See my observation.
ansh_kumar
25-Jan-14 3:20am
View
Yes I write it by myself...
Few improvements i found myself are:
1) First the base64 encode and decode functions are working absolutely well.It's the error in the read_file() and main() function.
In my update for the solution I put FEdata = read_file(); out of the while loop in the main() function because the file has to read only once.
2) It's the problem in data = FEdata[upload_ctx.lines_read]; in the while loop. I think in the 2D array (*FEdata)[] visual c++ is not putting '\0' after after reading the 54 chars from the file where as in mingw it does.
So when i write data = FEdata[upload_ctx.lines_read]; and use str = std::string(data); in the loop every time the whole 2D array is converted into the std::string which is what we see in the output.
I hope you are getting what am saying..
ansh_kumar
25-Jan-14 2:49am
View
Can you suggest any improvement in the code???
ansh_kumar
25-Jan-14 2:36am
View
See the following for the output from two compilers.
ansh_kumar
25-Jan-14 2:33am
View
Deleted
the output from mingw if this:
<pre lang="text">
SW4gb3RoZXIgd29yZHMNCk1BQyBhZGRyZXNzOiCTWFktWFgtWFgtWFgtWFgtWFiUIJNYlCBjYW4gYmUg
YW55dGhpbmcgaGV4YWRlY2ltYWwuIFRoZSBoZXhhZGVjaW1hbCCTWZQsIHdyaXR0ZW4gaW4gYmluYXJ5
IGZvcm1hdCwgaXMgWTogk2ttbnCULCB3aGVyZSCTcJQgaXMgdGhlIGxlYXN0IHNpZ25pZmljYW50IGJp
dDsNCg0KICAgICAgICBwPTAgLS0+IHVuaWNhc3Q7IA0KICAgICAgICBwPTEgLS0+IG11bHRpY2FzdDsg
DQogICAgICAgIG49MCAtLT4gZ2xvYmFsbHkgYXNzaWduZWQgTUFDOyANCiAgICAgICAgbj0xIC0tPiBs
b2NhbGx5IGFkbWluaXN0ZXJlZDsgDQpTbywgYWN0dWFsbHkgTUFDIGNhbiBiZSBjaGFuZ2VkIHRvIGFu
eSBjb21iaW5hdGlvbiBpbiB3aGljaCBwPTAgYW5kIG49MTsNCg0Kk1mUIGNhbiBiZSAyLCA2LCBBIG9y
IEUuDQoNClNvIHRoZSBwb3NzaWJsZSBNQUMgYWRkcmVzc2VzIGluIFdpbmRvd3MgNyBmb3Igd2lyZWxl
c3MgYWRhcHRlcnM6
In other words
MAC address: ôXY-XX-XX-XX-XX-XXö ôXö can be anything hexadecimal. The hexadecima
l ôYö, written in binary format, is Y: ôkmnpö, where ôpö is the least significan
t bit;
p=0 --> unicast;
p=1 --> multicast;
n=0 --> globally assigned MAC;
n=1 --> locally administered;
So, actually MAC can be changed to any combination in which p=0 and n=1;
ôYö can be 2, 6, A or E.
So the possible MAC addresses in Windows 7 for wireless adapters:
</pre>
But from the visual c++ it is :
<pre lang="text">
SW4gb3RoZXIgd29yZHMNCk1BQyBhZGRyZXNzOiCTWFktWFgtWFgtWFgtWFgtWFiUIJNYlCBjzc3NYW4g
YmUgYW55dGhpbmcgaGV4YWRlY2ltYWwuIFRo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IGNhbiBiZSBjaGFuZ2VkIHRvIGFu
eSBjb21iaW5hdGlvbiBpbiB3aGljaCBwPTAgYW5kIG49MTsNCg0Kk1mUIGNhbiBiZSAyLCA2LCBBIG9y
IEUuDQoNClNvIHRoZSBwb3NzaWJsZSBNQUMgYWRkcmVzc2VzIGluIFdpbmRvd3MgNyBmb3Igd2lyZWxl
c3MgYWRhcHRlcnM6
In other words
MAC address: ôXY-XX-XX-XX-XX-XXö ôXö can be anything hexadecimal. The hexadecima
l ôYö, written in binary format, is Y: ôkmnpö, where ôpö is the least significan
t bit;
p=0 --> unicast;
p=1 --> multicast;
n=0 --> globally assigned MAC;
n=1 --> locally administered;
So, actually MAC can be changed to any combination in which p=0 and n=1;
ôYö can be 2, 6, A or E.
So the possible MAC addresses in Windows 7 for wireless adapters:
</pre>
But from the visual c++ it is :
<pre lang="text">
SW4gb3RoZXIgd29yZHMNCk1BQyBhZGRyZXNzOiCTWFktWFgtWFgtWFgtWFgtWFiUIJNYlCBjzc3NYW4g
YmUgYW55dGhpbmcgaGV4YWRlY2ltYWwuIFRoZSBoZXhhZGVjaW1hbCCTWZQsIHdyaXR0zc3NZW4gaW4g
YmluYXJ5IGZvcm1hdCwgaXMgWTogk2ttbnCULCB3aGVyZSCTcJQgaXMgdGhlIGxlzc3NYXN0IHNpZ25p
ZmljYW50IGJpdDsNCg0KICAgICAgICBwPTAgLS0+IHVuaWNhc3Q7IA0KICAgzc3NICAgICBwPTEgLS0+
IG11bHRpY2FzdDsgDQogICAgICAgIG49MCAtLT4gZ2xvYmFsbHkgYXNzzc3NaWduZWQgTUFDOyANCiAg
ICAgICAgbj0xIC0tPiBsb2NhbGx5IGFkbWluaXN0ZXJlZDsgDQpTzc3NbywgYWN0dWFsbHkgTUFDIGNh
biBiZSBjaGFuZ2VkIHRvIGFueSBjb21iaW5hdGlvbiBpbiB3zc3NaGljaCBwPTAgYW5kIG49MTsNCg0K
k1mUIGNhbiBiZSAyLCA2LCBBIG9yIEUuDQoNClN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