need help on sending smtp email

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2006
Posts: 3
Reputation: lewisy is an unknown quantity at this point 
Solved Threads: 0
lewisy lewisy is offline Offline
Newbie Poster

need help on sending smtp email

 
0
  #1
Jul 26th, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,628
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 468
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: need help on sending smtp email

 
0
  #2
Jul 26th, 2006
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.
I don't accept change; I don't deserve to live.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: need help on sending smtp email

 
0
  #3
Jul 26th, 2006
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC