0 votes

Hi there I'm trying to work out if mail.dll has it's own SMTP engine, apologies I'm not a programmer so not sure if of the correct terminology. I do the server stuff.

I'll explain we have an inhouse application and our programmer who took over from our last one isn't sure of how something works (Because the last guy either didn't do any comments or removed them all).

Basically the email is being placed into a folder (It's not default IIS or any other mail servers queue folder that I'm aware of) on the server and once the the message is in that folder it gets processed (Win 2008 R2).

I don't program but I'm not illiterate and can see from your documentation you have an smtp.connect but thought I'd make sure before I spend an age trying to work out how mail is being sent.

Many thanks

by (410 points)

1 Answer

+1 vote
 
Best answer

The answer is yes Mail.dll includes a STMP client.

You can use this client to connect to SMTP server and send an email message.

Most basic example of code that does that is:

IMail email = Mail
    .Html(@"Html with an image: <img src=""cid:lena"" />")
    .AddVisual("c:\\lena.jpeg").SetContentId("lena")
    .AddAttachment("c:\\tmp.doc").SetFileName("document.doc")
    .To("to@example.com")
    .From("from@example.com")
    .Subject("Subject")
    .Create();

using(Smtp smtp = new Smtp())
{
    smtp.Connect("smtp.server.com");  // or ConnectSSL for SSL
    smtp.UseBestLogin("user", "password");

    smtp.SendMessage(email);                      

    smtp.Close();    
}
by (301k points)
selected by
Hi there apologies, think I may not have explained it very well, although I think you may have answered my question indirectly. I was looking to see if mail.dll had a smtp server function and not if it could relay through another server.
I'm just trying to rule out mail.dll as the component that picks up the email from the folder I mentioned above.

I suspect your answer means no, no SMTP server part.

Many thanks
Mail.dll is not a SMTP server, it's a SMTP client. It doesn't have the watcher that checks the folder for new messages to sent, however it would be fairly easy to create such code and use Mail.dll to send such messages.
Thanks for that, looks like I'm going to have to spend alot more time looking, really appreciate your help.
Hi, I'd like to thank you for your help yesterday, it led me in the right direction of finding out what he was doing, so at least we can move forward and you saved me a load of work as well, it's much appreciated.
...