资 源 简 介
This a COde to Send Emails with attachement very easily.
You ca use it as an executable, or in you .Net project.
Create you Form, create a Button and Enjoy.
System::Void MyForm::SendOrder_Click(System::Object^ sender, System::EventArgs^ e)
{
List
Items
String
^Filename
Filename = IO::Path::Combine(System::Environment::GetEnvironmentVariable("TEMP"),
String::Concat("FCSSystem", IO::Path::GetRandomFileName(), ".txt"))
Items.Add(Convert::ToString(DateTime::Now))
for(int ni=0 niControls->Count ni++)
{
Items.Add(String::Concat(OrderPanel->Controls[ni]->Controls[0]->Name,"Q",
((NumericUpDown^)OrderPanel->Controls[ni]->Controls[1])->Value))
}
IO::File::WriteAllLines(Filename, Items.ToArray())
SendFileTo::MAPI mapi
mapi.AddRecipientTo("sst@fcssystem.com")
mapi.AddAttachment(Filename)
mapi.SendMailPopup("FCS System Order", "Please Write Your Data Here")