944,188 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1868
  • C RSS
Jul 26th, 2006
0

need help on sending smtp email

Expand Post »
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:

  1. static STATUS_T sendMail(string mailHost, string mailTo, string mailFrom, string mailSub, string mailBody)
  2. {
  3.  
  4. CSMTPConnection conn;
  5. CA2CT mailHostConverted(mailHost.c_str());
  6. CA2CT mailToConverted(mailTo.c_str());
  7. CA2CT mailFromConverted(mailFrom.c_str());
  8. CA2CT mailSubConverted(mailSub.c_str());
  9. CA2CT mailBodyConverted(mailBody.c_str());
  10.  
  11. conn.Connect(mailHostConverted);
  12. CMimeMessage msg;
  13. msg.SetSender(mailFromConverted);
  14. msg.AddRecipient(mailToConverted);
  15. msg.SetPriority(ATL_MIME_HIGH_PRIORITY);
  16. msg.AddText(mailBodyConverted);
  17. msg.SetSubject(mailSubConverted);
  18. conn.SendMessage(msg);
  19.  
  20. return status;
  21. }

So the mail should look like:

hi ............

regards,
:mrgreen:

sth like this.... please help thanks
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
lewisy is offline Offline
3 posts
since Jul 2006
Jul 26th, 2006
0

Re: need help on sending smtp email

Maybe the documentation of the external library you are currently using will have some pointers on how u can go about doing this.

Also without the complete code it becomes difficult to think of a solution.

HOpe it helped,
bye.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Jul 26th, 2006
0

Re: need help on sending smtp email

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.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Help on arrays
Next Thread in C Forum Timeline: Direct Sound Help (Creating a sound buffer)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC