VB.net에서 여러 전자 메일 주소로 텍스트 파일 첨부 파일을 보내 전자 메일을 자동화하는 문제가 있습니다. 이상한 부분은 우리가 2 명에게 메일을 보내면 첫 번째 사람은 이메일을 받지만 두 번째 사람은받지 못한다는 것입니다. 3 개의 이메일 주소를 추가하면 첫 번째 두 개의 이메일 주소로 이메일이 수신되지만 세 번째 이메일 주소에는 수신되지 않습니다. 이메일 주소를 추가 할 때이 방법으로 계속 진행됩니다. 또한 스크립트를 두 번 실행하는 동안 전자 메일은 모든 수신자에게 전달됩니다. 정확히 말하면 스크립트를 대체 실행 한 모든 수신자가 전자 메일을 수신합니다. 메일 서버 등의 시간과 관련이 있습니까? 마지막으로 작업을 수행하기 위해 마지막 전자 메일 주소에 대한 전자 메일 보내기 명령을 두 번 실행합니다. 나는 이것이 영구적 인 해결책이 아니라는 것을 알고있다. 도움을 주시면 감사하겠습니다. 미리 감사드립니다. 마지막 전자 메일 주소로 여러 전자 메일을 보내지 못했습니다.
public void Main()
{
SmtpClient client = new SmtpClient("1.1.1.1", 25);
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Credentials = new NetworkCredential("support", "support");
MailMessage EM1= new MailMessage("[email protected]", "[email protected] ",
"This is my subject" + " " + " ", "Hello,");
EM1.Attachments.Add(new Attachment(@"F:\WebData\TxtFiles\1.txt"));
client.Send(EM1);
Dts.TaskResult = (int)ScriptResults.Success;
MailMessage EM2 = new MailMessage("[email protected]", "[email protected]",
"This is my subject" + " " + " ", "Hello,");
EM2.Attachments.Add(new Attachment(@"F:\WebData\TxtFiles\1.txt"));
client.Send(EM2);
Dts.TaskResult = (int)ScriptResults.Success;
MailMessage EM3 = new MailMessage("[email protected]", "[email protected]",
"This is my subject" + " " + " ", "Hello,");
EM3.Attachments.Add(new Attachment(@"F:\WebData\TxtFiles\1.txt"));
client.Send(EM3);
client.Send(EM3);
Dts.TaskResult = (int)ScriptResults.Success;
}
}
}
코드가 붙여졌습니다. – Isha
VB.net 코드와 비슷합니다. VB.net과 VBScript는 다른 언어입니다. –
지적 해 주셔서 감사합니다. 나는 이것 (프로젝트조차도)에 완전히 새로운 것이다. 이 코드는 동료가 작성했습니다. 이 태그를 다른 태그로 태그해야합니까? – Isha