| | |
need help on sending smtp email
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2006
Posts: 3
Reputation:
Solved Threads: 0
Hi,
I need to send an email through the smtp server. The hard part about this is that I need to embed a jpeg signature at the end of the mail. But this signature is not an attachment. any ideas on how to do that? I am using CMIMEMessage and it looks like it can not do so...
my code is like this:
So the mail should look like:
hi ............
regards,
:mrgreen:
sth like this.... please help thanks
I need to send an email through the smtp server. The hard part about this is that I need to embed a jpeg signature at the end of the mail. But this signature is not an attachment. any ideas on how to do that? I am using CMIMEMessage and it looks like it can not do so...
my code is like this:
C Syntax (Toggle Plain Text)
static STATUS_T sendMail(string mailHost, string mailTo, string mailFrom, string mailSub, string mailBody) { CSMTPConnection conn; CA2CT mailHostConverted(mailHost.c_str()); CA2CT mailToConverted(mailTo.c_str()); CA2CT mailFromConverted(mailFrom.c_str()); CA2CT mailSubConverted(mailSub.c_str()); CA2CT mailBodyConverted(mailBody.c_str()); conn.Connect(mailHostConverted); CMimeMessage msg; msg.SetSender(mailFromConverted); msg.AddRecipient(mailToConverted); msg.SetPriority(ATL_MIME_HIGH_PRIORITY); msg.AddText(mailBodyConverted); msg.SetSubject(mailSubConverted); conn.SendMessage(msg); return status; }
So the mail should look like:
hi ............
regards,
:mrgreen:
sth like this.... please help thanks
Does this even compile?
> return status;
I see no status declared anywhere.
> CA2CT mailHostConverted(mailHost.c_str());
This looks like it's stuck half way between a function prototype and a function call.
> conn.Connect(mailHostConverted);
I imagine this returns a status, why not test that to see whether the connect failed or not.
> return status;
I see no status declared anywhere.
> CA2CT mailHostConverted(mailHost.c_str());
This looks like it's stuck half way between a function prototype and a function call.
> conn.Connect(mailHostConverted);
I imagine this returns a status, why not test that to see whether the connect failed or not.
![]() |
Similar Threads
- Sending an acknowledgement via Email while storing data in ASP.NET1.0 (ASP.NET)
- Sending HTML email via PHP mail function (PHP)
- Email application (Java)
- SMTP Times out in CommuniGate Pro (*nix Software)
- Sending form email (PHP)
- Error message when running ASP email script (ASP)
Other Threads in the C Forum
- Previous Thread: Help on arrays
- Next Thread: Direct Sound Help (Creating a sound buffer)
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings structures suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






