|
|
Is there any kind of documentation on this? I am just trying to run the SMTP Server but want to put it inside my existing application to run the server only when its needed.
Russ
|
|
|
|
|
I got a client sending a message with 2 attachments (2 files) as the example Ivan shown me. I activated the smtp server and got a receive event triggered as follows:
private void aSvr_MessageStoringCompleted(object ax, LumiSoft.Net.SMTP.Server.MessageStoringCompleted_eArgs e)
{
LumiSoft.Net.Mime.Mime aM = new LumiSoft.Net.Mime.Mime();
aM = LumiSoft.Net.Mime.Mime.Parse(e.MessageStream);
LumiSoft.Net.Mime.MimeEntity[] aTTx = aM.Attachments;
}
The MainEntity of aM after the parse mostly are nulls, am I doing something wrong? I sent a mail with 2 file attached as follows in my client code:
Mime m = new Mime();
MimeEntity mainEntity = m.MainEntity;
// Force to create From: header field
mainEntity.From = new AddressList();
mainEntity.From.Add(new MailboxAddress("oing", "oing.u@l-4.com"));
// Force to create To: header field
mainEntity.To = new AddressList();
mainEntity.To.Add(new MailboxAddress("oing u", "oPS@gvlexchrtr.l-43.com"));
mainEntity.Subject = "subject is test";
mainEntity.ContentType = MediaType_enum.Multipart_mixed;
MimeEntity textEntity = mainEntity.ChildEntities.Add();
textEntity.ContentType = MediaType_enum.Text_plain;
textEntity.ContentTransferEncoding = ContentTransferEncoding_enum.QuotedPrintable;
textEntity.DataText = "Message body text.";
MimeEntity attachmentEntity = new MimeEntity();
attachmentEntity.ContentType = MediaType_enum.Application_octet_stream;
attachmentEntity.ContentDisposition = ContentDisposition_enum.Attachment;
attachmentEntity.ContentTransferEncoding = ContentTransferEncoding_enum.Base64;
attachmentEntity.ContentDisposition_FileName = "testatta.xxx";
attachmentEntity.DataFromFile("testatta.xxx");
mainEntity.ChildEntities.Add(attachmentEntity);
attachmentEntity = new MimeEntity();
attachmentEntity.ContentType = MediaType_enum.Application_octet_stream;
attachmentEntity.ContentDisposition = ContentDisposition_enum.Attachment;
attachmentEntity.ContentTransferEncoding = ContentTransferEncoding_enum.Base64;
attachmentEntity.ContentDisposition_FileName = "testatta.txt";
attachmentEntity.DataFromFile("testatta.txt");
mainEntity.ChildEntities.Add(attachmentEntity);
LumiSoft.Net.SMTP.Client.SmtpClientEx.QuickSendSmartHost("localhost", 27, "localhost", m);
This email did ok when I sent it to Exchange server, but when I change it to sent to local smtp server, I got nulls in the MainEntity as described above. Thanks for your assistance in advance.
|
|
|
|
|
Hi,
The problem is "e.MessageStream" is at the end of stream when passes to that event.
This si because, you may pass such storage stream what doesnt support seeking, because of it i may not set position to 0.
If you passed, seekable stream for storage, just set e.MessageStream = 0, before parsing.
|
|
|
|
|
Ok, I will give it a shot, thanks for the reply!
|
|
|
|
|
Brilliant, it worked as Lumi said...Thanks again.
|
|
|
|
|
Hello,
this subject has been already talked about but I don't find it.
How do you extract Eml Attachment from attach files?
When I enter in my saveattachfiles (loop on the attachfiles collection), the attachments contains well an attach file but the dataproperty is null...
thanks
Mekongboy
|
|
|
|
|
|
HI,
I use the version above which is in download on codeproject.com
|
|
|
|
|
I think, its very old version.
|
|
|
|
|
|
I was wondering how you do attachment(like a picture) with the smtp client and how you handle that in smtp server?
btw, thanks for the great code!
Master of the last path
|
|
|
|
|
Hi,
I dont get exactly what you mean.
|
|
|
|
|
In the client code, there is no property for an attached file(attachment), the client can only send text or bytes. For example:
aClient = new LumiSoft.Net.SMTP.Client.SMTP_Client();
aClient.Port = 25;
aClient.SmartHost = "blahblah.is.l-43com.com";
string[] mailDestination = new string[1];
mailDestination[0] = "someones email address";
Stream aMailBodyStream = new MemoryStream();
bool okOrnot = aClient.Send(mailDestination, "tumitoto@l-43com.com", aMailBodyStream);
There is no place for me to attach a file with the mail message above.
|
|
|
|
|
|
Ok, that works, thanks! Now I am having a server problem, I will do that in a different thread.
|
|
|
|
|
Hey,
I am writing a PUSH mail server in C# which means I will have to create a SMTP server to send/recieve external emails. How on earth do I send mail from my SMTP server to an arbitrary SMTP server? I don't mind writing a little (ok, much) code, but I noticed that to send email via my SMTP server I need to log in. So then how do I send mail to a server that requires logins?
Is the client actually a client/server? What is mean is can I assume that the communication from the client to the server is EXACTLY the same as a server to server?
All I need is what to send in plain old ASCII, I got TCP/IP under my belt. Tell me that server->server is the same as client->server and I will be just as happy.
Thanks!
Jonathan Dickinson
|
|
|
|
|
Hi,
>How on earth do I send mail from my SMTP server to an arbitrary SMTP server?
I dont get what you mean exactly. Are you talking about getting destination email domain IP addresses ?
>So then how do I send mail to a server that requires logins?
uhuu, what can i say you just need to login, thats all.
>Is the client actually a client/server? What is mean is can I assume that the communication from >the client to the server is EXACTLY the same as a server to server?
Nope, smtp client and servers 2 different things. Client sends message, while smtp server receives. So full functional mail server will use smtp server and client components.
Relay part in mail server is actually smtp client.
|
|
|
|
|
Is there a simple way to use this mail server as an e-mail robot to execute an application or pass the message to a class implementing an interface when new e-mail arrives in a particular mail box? Alternately, which class would you suggest modifying to implement this functionality?
Thanks,
Anthony
-- modified at 16:43 Wednesday 25th July, 2007
After poking around a bit. It looks like the filter functionality probably does what I'm looking for. Do you have any documentation on creating a new filter? Most of the settings seem intuitive, but what does the "Cost" value do?
-- modified at 17:01 Wednesday 25th July, 2007
The spam filter code looks like it should be sufficient to guide me, but I'd still like to know what the "Cost" value is for.
|
|
|
|
|
Hi,
Yes filter is right way to go.
Cost means process order, lower value means higher processing priority.
In real life what that gives, for example you put some fast easy spam check before hard virus scan, then if smap filter rejects message, next filters not executed.
NOTE:
If you code something, ensure that you use latest 0.92 version !!!
|
|
|
|
|
I dont know whther this is the right place to ask this doubt.
I would like to use Mail Sending program in ASP.NET in Web pages and which is working fine in windows, but when I am deploying this application on Suse-linux which is configured with mod_mono, it is displaying me error.
Here is the code
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
msg.To.Add("abcd@gmail.com");
msg.From = new MailAddres("abcd@gmail.com","null",System.Text.Encoding.UTF8);
msg.Subject = "Test Subject";
msg.Body = "This is my msg Body";
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("xyz@gmail.com", "pwd123");
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
client.SendCompleted += new SendCompletedEventHandler(client_SendCompleted);
client.Send(msg);
1. I am not able to understand that what changes should I have to do at SuseLinux machine so that this code works there too.
2. Do I have to edit the mod_mono or apache configuration to listen smtp at suse?
3. Sending mail through postfix at suselinux machine is working fine thru command line.
I will appreciate you for helping me.
Thanks in advance
Vertis
|
|
|
|
|
|
Hi, firstly - thanks for all the hard effort & all the code - stunning.
Next a question :
Is it possible to configure the mail server to collect from one or more "catch all" pop3 accounts rather than on a user by user basis ?
Thanks in advance.
|
|
|
|
|
Hi,
Yep, you can, just do route like * to 1 mailbox ... that will do the trick.
|
|
|
|
|
Thanks, but I think I am still a little confused.
I'd like to collect via pop3 from a remote mailserver for delivery into a domain on the luimusoft mailserver, which in turn splits the incoming pop3 and "delivers" it to the user(s) mailbox(s) according to the rules.
So to clarify - the lumisoft mailserver would be collecting from not delivering to a catch all pop3.
I can see what looks like where you can configure the collection for individual users but what about for entire domain(s) ?
Sorry if this is a no brainer - just can't seem to see it in the manager interface.
Many thanks in advance.
|
|
|
|