제 질문을 보내 주셔서 감사합니다.opennetcf.net.mail 첨부 파일 도움말
OpenNetCF.Net.Mail의 첨부 파일을 찾으려고합니다.
Attachment myAttachment = new Attachment();
message.Attachments.Add(myAttachment);
문제는 내가 방법을 알아낼 수 없다는 것입니다 : 그것은 예정이다
public static void SendMessage(string subject,
string messageBody,
string fromAddress,
string toAddress,
string ccAddress)
{
MailMessage message = new MailMessage();
SmtpClient client = new SmtpClient();
MailAddress address = new MailAddress(fromAddress);
// Set the sender's address
message.From = address;
// Allow multiple "To" addresses to be separated by a semi-colon
if (toAddress.Trim().Length > 0)
{
foreach (string addr in toAddress.Split(';'))
{
message.To.Add(new MailAddress(addr));
}
}
// Allow multiple "Cc" addresses to be separated by a semi-colon
if (ccAddress.Trim().Length > 0)
{
foreach (string addr in ccAddress.Split(';'))
{
message.CC.Add(new MailAddress(addr));
}
}
// Set the subject and message body text
message.Subject = subject;
message.Body = messageBody;
// TODO: *** Modify for your SMTP server ***
// Set the SMTP server to be used to send the message
client.Host = "smtp.dscarwash.com";
string domain = "dscarwash.com";
client.Credentials = new SmtpCredential("mailuser", "dscarwash10", domain);
// Send the e-mail message
try
{
client.Send(message);
}
catch (Exception e)
{
string data = e.ToString();
}
}
첨부 할 수 있도록 다음과 같은 방법으로 그것을 조정의 문제가 될 : 여기 내 센드 메일 기능에 대한 코드는 첨부 파일을 추가 할 수 있습니다. 위의 줄은 내가 첨부하고 싶은 파일을 실제로 말하고있는 중간에 뭔가 있어야합니다. 이 문제에 대한 도움은 크게 감사하겠습니다.
다시 한번 감사드립니다!
여러 개의 첨부 파일이나 그 종류의 것을 원하십니까? –
하나의 첨부 파일, zip 파일 – jnsohnumr
첨부 할 때 어떤 코드를 사용하고 있으며 어떤 오류가 있습니까? 아니면 Attachment 클래스에 파일을 추가하는 데 필요한 API가없는 것입니까? – Quibblesome