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

Recommended Answers

All 2 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.