nilnull / aim Goto Github PK
View Code? Open in Web Editor NEWAegis Implicit Mail
Home Page: http://pki.tools/aim.html
License: MIT License
Aegis Implicit Mail
Home Page: http://pki.tools/aim.html
License: MIT License
Reported by nilnull on 2014-09-22 04:04 UTC
Generate a component to send mails specifically for gmail
Reported by phnx47 on 2014-12-23 12:36 UTC
Custom encoding isn't supported.
Unicode is not correctly found and set in some languedges. (Please add your languedges in comments so we can add priorities and testings).
Reported by nilnull on 2015-01-19 03:13 UTC
Reported by nilnull on 2014-09-20 12:41 UTC
Currently the asynchronous mail sending delegate function does not returns enough informations for implicit and smime mails. That should be improved
Reported by nilnull on 2014-09-20 12:39 UTC
Generate an abstract factory class for users to be able to handle all types of mails in one single class
Is there a way to get any result/status information if using the SendMail instead of the SendMailAsync?
SendMail returns void.
Thanks.
Reported by lenj1146 on 2017-04-25 23:10 UTC
My issue appears similar to ticket #12, How to use custom formatted HTML body. I need to send formatted emails via code and all my formatting gets removed.
Reported by srikanthaj on 2018-02-02 03:40 UTC
Please add capability to send mailmessages with alternatevies, it helps is embed inline images with Linkedresources.
TestConnection() method raises NullReferenceException when called without internet connection available.
Exception : {"Object reference not set to an instance of an object."} | System.NullReferenceException
StackTrace : " at AegisImplicitMail.SmtpSocketClient.QuiteConnection(String& response, Int32& code)\r\n at AegisImplicitMail.SmtpSocketClient.TestConnection()\r\n "
InnerException: null
Reported by cado2010sf on 2016-10-20 12:29 UTC
Hi
We're using AIM nuget in our Web API project to send email notifications. Our email body contains custom formatted HTML, like links with hrefs and link text. We also need to separate lines with
. Aegis library seems to be formatting the HTML body on its own. For example, single carriage (CR/LF) returns are not honored, they are removed. Double CRLFs seem to be replaced with
and any custom formatted HTML like a link () or
seems to be getting HTML encoded.
I want to know how to format HTML content body but not have Aegis perform its own HTML encoding of the body.
Thanks!
-Srikanth
Reported by ei5fuch5 on 2016-06-09 12:25 UTC
I can't set the Content-Type of the mail to text/html.
IsBodyHtml = true
and
var nvc = new NameValueCollection {{"Content-Type", "text/html"}};
Headers = { nvc }
are ignored by the lib. The Content-Type of the Mail is always:
Content-Type: multipart/mixed; boundary="32d5b61c-4617-4b20-aac7-06fa4f4ebbc5"
Reported by naveenpapagari on 2017-01-23 05:56 UTC
I have been using Aegis Implicit Mail (AIM) to send mails over ssl for some time. We have recently upgraded to TLS 1.2 and now i am not able to send any mails. I have been getting error saying - The client and server cannot communicate, because they do not possess a common algorithm. Need help on this ... Thank you
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
};
mymessage.Attachments.Add(new MimeAttachment(FilePath));
((SmtpSocketClient)mailer).SslType = SslMode.Ssl;
mailer.SendCompleted += SendCompleted;
mailer.SendMailAsync(mymessage);
Please update documentation, and eventually the code to take into account the automatic addition of a proper Message-Id as it may
happen that the first-hop SMTP server used to the send the email is not actively adding the missing header.
I installed the package using package manager "NuGet\Install-Package AIM -Version 1.1.1" and can that it is installed
However trying using AegisImplicitMail;
gets me
he type or namespace name 'AegisImplicitMail' could not be found
What's wrong here ?
Hi,
I had problems when sending mails to multiple recipients using some SMTP servers. After comparing the headers produced by AIM and Thunderbird I recognized, that Thunderbird uses "," as delemiter between multiple addresses and AIM using ";". According to rfc6068 the ","seems to be the correct way. After changing the 3 occurences in the SendMail() function it worked fine with all my test SMPT providers. Maybe you can double check if "," realy is correct and if so update your code base.
best regards, Christian
Reported by nilnull on 2015-04-06 12:54 UTC
Conversion of System.Net.Mail.Attachment objects to the MimeAttachment type.
Reported by nilnull on 2015-04-06 12:52 UTC
One of the constructors for Attachment allows for supplying a content stream, but the constructors for MimeAttachment hide this and make it unusable.
Providers like GMX does not accept all data in one single line in body.
The specified value of maximum characters per line is exceeded very fast when sending attachments.
I have made a console application and deployed on ubuntu server , I am getting above error , can you suggest me solution
Hi,
as I had problems when using some characters in an extended from: field (e.g. "Max Müller [email protected]").
I repaced the line "buf.Append(MailMessage.From);" in SendMail() with "buf.Append(GetEncodedFromAddress());" and added the following code to SmtpSocketClient.cs
`
private object GetEncodedFromAddress()
{
var headersEncoding = MailMessage.HeadersEncoding ?? Encoding.UTF8;
if (Encoding.ASCII.Equals(headersEncoding))
{
return MailMessage.From;
}
else
{
byte[] bytes = headersEncoding.GetBytes(MailMessage.From.DisplayName);
var encodingName = headersEncoding.BodyName.ToLower();
string qpEncodedName = QuotedPrintableConverter.Encode(MailMessage.From.DisplayName);
string encoded = "=?" + encodingName + "?Q?" + qpEncodedName + "?= <" + MailMessage.From.Address + ">";
return encoded;
}
}
`
also I added the follwing class (from https://dotnet-snippets.de/snippet/quoted-printable-encoder/778) used by the function above:
`
using System.Text;
namespace AegisImplicitMail
{
public class QuotedPrintableConverter
{
private static string _Ascii7BitSigns;
private const string _equalsSign = "=";
private const string _defaultReplaceEqualSign = "=";
/// <summary>
/// Ctor.
/// </summary>
private QuotedPrintableConverter()
{
//do nothing
}
/// <summary>
/// Encodes a not QP-Encoded string.
/// </summary>
/// <param name="value">The string which should be encoded.</param>
/// <returns>The encoded string</returns>
public static string Encode(string value)
{
return Encode(value, _defaultReplaceEqualSign);
}
/// <summary>
/// Encodes a not QP-Encoded string.
/// </summary>
/// <param name="value">The string which should be encoded.</param>
/// <param name="replaceEqualSign">The sign which should replace the "="-sign in front of
/// each QP-encoded sign.</param>
/// <returns>The encoded string</returns>
public static string Encode(string value, string replaceEqualSign)
{
//Alle nicht im Ascii-Zeichnsatz enthaltenen Zeichen werden ersetzt durch die hexadezimale
//Darstellung mit einem vorangestellten =
//Bsp.: aus "ü" wird "=FC"
//Bsp. mit Ersetzungszeichen "%"für das "=": aus "ü" wird "%FC"
GetAllowedAsciiSigns();
StringBuilder sb = new StringBuilder();
foreach (char s in value)
{
if (_Ascii7BitSigns.LastIndexOf(s) > -1)
sb.Append(s);
else
{
string qp = string.Format("{0}{1}",
_equalsSign,
System.Convert.ToString(s, 16)).Replace(_equalsSign, replaceEqualSign);
sb.Append(qp);
}
}
return sb.ToString();
}
/// <summary>
/// Gets a string which contains the first 128-characters (ANSII 7 bit).
/// </summary>
private static void GetAllowedAsciiSigns()
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 127; i++)
{
sb.Append(System.Convert.ToChar(i));
}
_Ascii7BitSigns = sb.ToString();
}
}
}
`
PS: sorry, I could not get the code propperbly recogniced using the "Add code" formater
I can choose between various encodings (other than ASCII7 like "iso-8859-1") using the third parameter of System.Net.Mail.MailAddress(string address, string displayName, Encoding displayNameEncoding) when set the MimeMailMessage.From property.
Maybe you can check this and integrate such a feature in your code.
best regards, Christian
Reported by nilnull on 2015-04-11 15:48 UTC
Some users have been complaining about the time and date of emails
Reported by nilnull on 2015-04-11 15:46 UTC
An attempt to send an email using implicit SSL with AIM currently results in the following error: Mono: The class System.Net.Security.EncryptionPolicy could not be loaded, used in System, Version=4.0.0.0, Culture=neutral
Whilst strictly speaking this is a Mono issue, AIM could easily implement a workaround like the one described at mono/mono#1399
Reported by rkmoray on 2018-07-25 12:53 UTC
I amd trying to add an attachment to an email, When the add attachment line is read, I get an object error.
Here is the code
var mymessage = new MimeMailMessage
{
From = new MimeMailAddress(Mail),
Subject = "Web Purchase Receipt " + DateTime.Now.ToString("yyyyMMdd"),
Body = "body"
};
mymessage.To.Add("[email protected]");
var mailer = new MimeMailer(Host, 465)
{
User = User,
Password = Pass,
EnableImplicitSsl = true,
AuthenticationMode = AuthenticationType.Base64
};
var a = new MimeAttachment("c:\temp\Integra POS.pdf")
{
//ContentType = new ContentType("application/pdf"),
ContentType = new ContentType("application/octet-stream"),
Location = AttachmentLocation.Inline
};
AttachList.Add(a);
foreach (Attachment t in AttachList)
{
mailer.MailMessage.Attachments.Add((MimeAttachment)t);//Error on the line
}
((SmtpSocketClient)mailer).SslType = SslMode.Ssl;
mailer.SendCompleted += SendCompleted;
mailer.SendMailAsync(mymessage);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.