You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by rkmoray on 2018-07-25 17:42 UTC
My issue at the moment,is if an attachment is being used, the email does not get send, and there is no error message. The file name is correct, I have verified that. Whith this code I get no email, but no error message as well.
Here is an example
string strdtfile = DateTime.Now.ToString("yyyyMMddHHmmss");
string FilePath = @Server.MapPath("~/Temp/" + strdtfile + ".pdf");
currentReport.ExportToPdf(FilePath);
var mymessage = new MimeMailMessage();
mymessage.From = new MimeMailAddress(Mail);
mymessage.Subject = "Web Purchase Receipt " + DateTime.Now.ToString("yyyyMMdd");
mymessage.To.Add(Session["email"].ToString());
mymessage.Body = "";
mymessage.IsBodyHtml = true;
mymessage.To.Add(Session["email"].ToString());
var mailer = new MimeMailer(Host, 465)
{
User = User,
Password = Pass,
EnableImplicitSsl = true,
AuthenticationMode = AuthenticationType.Base64
};
Commented by dimex on 2019-04-14 12:45 UTC
Had the same issue, mail server reported: "554 Too long line was received" when I tried to add an attachment.
Fixed it by adding "\r\n" to stream chunks in SmtpSocketClient.cs, at the end of SendAttachments() method:
Commented by dimex on 2019-04-14 18:36 UTC
Attachment is sent as a base64-encoded string and it looks like some email servers (hMailServer in my case) have limits for string length . So basically I just split one huge line to smaller parts.
Reported by rkmoray on 2018-07-25 17:42 UTC
My issue at the moment,is if an attachment is being used, the email does not get send, and there is no error message. The file name is correct, I have verified that. Whith this code I get no email, but no error message as well.
Here is an example
string strdtfile = DateTime.Now.ToString("yyyyMMddHHmmss");
string FilePath = @Server.MapPath("~/Temp/" + strdtfile + ".pdf");
currentReport.ExportToPdf(FilePath);
var mymessage = new MimeMailMessage();
mymessage.From = new MimeMailAddress(Mail);
mymessage.Subject = "Web Purchase Receipt " + DateTime.Now.ToString("yyyyMMdd");
mymessage.To.Add(Session["email"].ToString());
mymessage.Body = "";
mymessage.IsBodyHtml = true;
mymessage.To.Add(Session["email"].ToString());
var mailer = new MimeMailer(Host, 465)
{
User = User,
Password = Pass,
EnableImplicitSsl = true,
AuthenticationMode = AuthenticationType.Base64
};
The text was updated successfully, but these errors were encountered: