SmtpSubmitToPickupFolder Method (String, Boolean)
Saves the mail message as a file in the pickup folder of MailBee.NET Queue or IIS SMTP service.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public string SubmitToPickupFolder(
	string pickupFolderName,
	bool doubleFirstDotAtLine


Type: SystemString
The full physical path to MailBee.NET Queue or IIS SMTP pickup folder (such as "C:\Inetpub\mailroot\Pickup").
Type: SystemBoolean
You must set it to true when submitting to IIS SMTP pickup folder and to false when using MailBee.NET Queue. SMTP protocol requires the client to double the dot character (make ".." from ".") when it appears at the beginning of a line. However, unlike MailBee.NET Queue, IIS SMTP service is not capable of performing this conversion, and doubleFirstDotAtLine parameter workarounds this (when true, MailBee itself will double dots when required).

Return Value

Type: String
On success, the filename (without folder path) of the file saved in the pickup folder; otherwise, a null reference (Nothing in Visual Basic).
MailBeeExceptionAn error occurred and ThrowExceptions is true.

This method can be used to submit messages directly to MailBee.NET Queue or IIS SMTP service bypassing SMTP protocol. This greatly improves performance of sending large volumes of e-mails when MailBee.NET Queue or IIS SMTP server is installed on the same machine or in the same LAN as the computer running MailBee. This method neither creates nor requires network connection.

Consider setting mailer.Message.Builder.SetDateOnSend to false when submitting to the pickup folder (mailer is Smtp instance). See SetDateOnSend for details.

Note Note
This method can return a null reference also if SubmittingMessageToPickupFolder even handler set SubmitIt to false.
This sample submits a mail message to IIS SMTP server by placing it in the pickup folder, and displays the full path to the stored .EML file.
Note Note
Usually, the stored message file is immediately picked up by IIS SMTP service and thus gets deleted from the pickup folder. That's normal behavior indicating IIS SMTP service is running. The same is true for MailBee.NET Queue.
// To use the code below, import these namespaces at the top of your code.
using System;
using MailBee;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();
mailer.From.Email = "";
mailer.Subject = "Report";
mailer.BodyPlainText = "The report contents";
string pickupFolderPath = @"C:\Inetpub\mailroot\Pickup";
string filename = mailer.SubmitToPickupFolder(pickupFolderPath, true);
Console.WriteLine("Saved into: " + pickupFolderPath + @"\" + filename);
See Also