954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

need help on sending smtp email

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:

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

lewisy
Newbie Poster
3 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

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.

~s.o.s~
Failure as a human
Administrator
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 734
 

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.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You