我尝试使用vb.net
发送电子邮件(gmail),下面是我的代码。
SmtpServer.Credentials = New Net.NetworkCredential(strUsername, DecryptPwd(strPassword))
SmtpServer.Port = strPort
SmtpServer.Host = strServer
SmtpServer.EnableSsl = True
Mail = New MailMessage()
strInvName = "Product's List"
Try
mail.From = New MailAddress(strUsername, strInvName, System.Text.Encoding.UTF8)
mail.To.Add(emailAddrs) '**this consists of 130+ recipients**'
mail.Subject = strSubject
mail.Body = ""
If File.Exists(Application.StartupPath & "\productList.pdf") = True Then
mail.Attachments.Add(New Attachment(Application.StartupPath & "\productList.pdf"))
Else
MsgBox("The Sale Invoice File Does Not Exists.Please Try Again", MsgBoxStyle.Exclamation, "RStar")
GoTo Quit
End If
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
mail.ReplyTo = New MailAddress(strUsername)
SmtpServer.Send(mail)
MsgBox("Product's List Sent Successfully", MsgBoxStyle.Information, "RStar")
mail.Dispose()
Catch exsr As SmtpFailedRecipientsException
MsgBox("Mail not recieved by the recipient,Please check the email id again", MsgBoxStyle.Information, "RStar")
mail.Dispose()
Catch exfr As SmtpFailedRecipientException
MsgBox("Mail not recieved by the recipient,Please check the email id again", MsgBoxStyle.Information, "RStar")
mail.Dispose()
Catch exse As SmtpException
MsgBox(exse.Message)
mail.Dispose()
Catch ex As Exception
MsgBox("Sending Failed.Please Try Again", MsgBoxStyle.Exclamation, "RStar")
mail.Dispose()
End Try
我一次发送给很多收件人。在我的情况下,我有 130个收件人发送
我收到此错误
Insufficient system storage. The server response was: 4.5.3 Your message has too many
recipients. For more information regarding
修改