Why use aspNetEmail instead of
.Net's built-in System.Web.Mail? |
|
System.Web.Mail is really an unmanaged call to CDONTS. When you
use System.Web.Mail you are actually making a COM call back to the unmanaged
world, thereby decreasing the performance of your application. aspNetEmail
offers unmatched speed and functionality. For some projects System.Web.Mail
will work fine. But if you want enterprise stability and functionality, look to
aspNetEmail. Check out our complete list of features
for more information.
|
|
|
|
Can I use aspNetEmail in a windows
application?
|
|
Yes! aspNetEmail is a .NET managed email component. All you need to run
aspNetEmail is the .NET framework runtime library. You can use aspNetEmail from
ASP.NET pages, Windows Forms, webservices, or just about any .NET application
you need email functionality.
|
|
|
|
What if I don't have CDONTS
installed on my machine, can I still run aspNetEmail?
|
|
Yes. Unlike System.Web.Mail, you do not need CDONTS installed on the computer
you are using aspNetEmail on.
|
|
|
|
If I have a hosted website, do I need
to contact my hosting provider to use aspNetEmail?
|
|
Nope. All you need to do is install aspNetEmail on your local machine. This
will extract the aspNetEmail.dll assembly. If you are using Visual Studio.NET,
then you simply need to upload the aspNetEmail.dll to your website (but not in
the /Bin directory). Then, set a reference to it using the “Browse” button. Do
not set a reference to the GAC assembly, as the hosted website will not have
aspNetEmail in the GAC. When you set a reference, VS.NET will
automatically move the aspNetEmail.dll to the /Bin directory. See our Tutorials for more information.
If you are not using VS.NET (or the compiled codebehind model), then you simply
need to upload the aspNetEmail.dll to your /Bin directory.
|
|
|
|
Can I read email with this
component?
|
|
Not at this time. aspNetEmail is a mail sending component only. For a mail
reading component, be sure to checkout www.aspNetPOP3.com
. aspNetEmail can be bundled with aspNetPOP3. For special pricing information,
be sure to check out www.aspNetEmail.com/purchase.aspx
.
|
|
|
|
When I send an email, it is
garbage text, or funny charaters. How do I change that?
|
|
'Funny' or strange characters come from the incorrect character set being set.
By default, aspNetEmail uses the us-ascii character set by default, in which,
all characters have an ASCII value less than 128. If a character is sent to the
mail reader, with a value higher than 127, the mail reader will split the
character into multiple characters. Thus, the EmailMessage.CharSet property
must be properly set to match the characters being sent in the email. Because
some mail gateways need all characters to be less than 128, aspNetEmail can
transparently code your text. This is achieved by setting
EmailMessage.ContentTransferEncoding = MailEncoding.QuotedPrintable. A few of
the more common character sets can be found below:
EmailMessage.CharSet Value
|
Common Name
|
hebrew
|
Hebrew
|
cskoi8r
|
Cyrillic (KOI8-R)
|
gb2312
|
Chinese Simplified (GB2312)
|
iso-8859-1
|
Western
|
iso-8859-2
|
Central European (ISO)
|
iso-8859-8
|
Hebrew (ISO-Visual)
|
koi8-r
|
Cyrillic (KOI8-R)
|
windows-1251
|
Cyrillic (Windows)
|
Please note, these character sets must be installed on the system using
aspNetEmail, or an exception will be thrown. For a larger subset of character
sets, click here.
When emailing HTML web pages, if the web page has the <META
CHARSET="some charset" > tag present, the EmailMessage.CharSet
property should match the same value as found in the MEATA tag.
|
|
|
|
How do I add file attachments?
|
|
Attaching a file to your email is simple with aspNetEmail. Here is an example
in C#.
From an ASP.NET page your code may look like: EmailMessage msg = new
EmailMessage();
msg.AddAttachment( Server.MapPath("invoice.pdf") );
If you are emailing from a Windows Form, your code may look like:
EmailMessage msg = new EmailMessage();
msg.AddAttachment( “invoice.pdf") );
|
|
|
|
How can I change the reply-to
address?
|
|
Changing the Reply-To address is handy, especially for large emailings. In this
example, email is sent from an unmonitored account called list@myCompany.com.
If any one replies to emails, they will be replied to at
marketing@myCompany.com. EmailMessage msg = new EmailMessage();
msg.FromAddress = "list@myCompany.com";
msg.ReplyTo = "marketing@myCompany.com";
|
|
|
|
What if I want to confirmation when
an email is read?
|
|
Here is a code example in C# to set a confirmation email. EmailMessage
msg = new EmailMessage();
msg.ConfirmRead = true;
*Please note, not all mail readers support this property.
|
|
|
|
Why can't I email from an AOL
address?
|
|
AOL requires a true “FROM” address in your email message. Be sure this field
has been properly set.
|
|
|
|
Why am I getting a "550 Relaying
Denied" error?
|
|
This is due to your SMTP server configuration. Your server is probably locked
down in some way to prevent spammers from abusing your mail server. To find out
how to better use your server, please contact your mail server administrator.
|
|
|
|
Does aspNetEmail require that the
component to be installed on the server? We are developing an application that
will be hosting on a 3rd party server that doesn't allow us to install
components.
|
|
aspNetEmail fully supports XCOPY deployment. You do NOT need to run the install
file on the remote server. Simply run the install file locally, to unpack the
aspNetEmail.dll, and then upload the aspNetEmail to the remote server. That’s
it.
|
|
|
|
Why can't I write to the system
log?
|
|
The system log needs higher permissions that you are currently running at. By
default ASP.NET pages cannot write to the system log, causing an error.
|
|
|
|
Why can't I write out a log file?
|
|
You need create\write permissions to write out the log to a text file. Make
sure you have permissions to accomplish this task. By default the ASP.NET
account cannot create or write to files on a webserver.
|
|
|
|
How do I perform a mail
merge?
|
|
Performing a mail merge is extremely easy with aspNetEmail. For both VB and C#
coding examples, refer to Examples.
|
|
|
|
Do I still need a mail server to
send email?
|
|
Although a rely server is recommended (to automatically handle queuing, bounce
backs, retries), it is not required. aspNetEmail has a
DirectSend object to handle sending email directly to the end
recipient. For more info, check out our
help file her.
|
|
|
|
We have question marks (?) that are appearing in the body. What is causing this?
|
|
Typically, this is the result of non us-ascii characters attempting to be displayed in the body of the message. Since the email client can’t render the characters correctly, it renders them as question marks. To correct this problem, use the correct characterset and set the ContentTransferEncoding property accordingly. For example:
EmailMessage m = new EmailMessage();
m.CharSet = "ISO-8859-1";
m.ContentTransferEncoding = MailEncoding.QuotedPrintableMinimal;
If you don't have version 3.0, or higher, of aspNetEmail, the QuotedPrintableMinimal option may not be available to you. Instead, use either the
QuotedPrintableRelaxed or QuotedPrintable MailEncoding options.
This problem typically occurs when people paste content from MS Office documents into the email message. Usually Office uses the ISO-8859-1 characterset.
|
|
|
|
I just installed aspNetEmail, and
I tried a sample page. I'm getting the error
Compiler Error Message: BC30002: Type 'EmailMessage' is not defined.
Source Error:
Line 30:
Line 31: Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Line 32: Dim msg As EmailMessage = New EmailMessage()
What's wrong?
|
|
The ASP.NET process cannot locate the aspNetEmail.dll for a reference.
Depending upon your situation, different solutions (or a combination thereof)
are required.
Solution 1: If you are using VS.NET with the codebehind model,
you will need to Import the aspNetEmail.dll into your project. Then you will
need to set a reference to the aspNetEmail.dll. VS.NET will then properly move
the aspNetEmail.dll to the /bin directory.
Solution 2: If you’ve already set a reference to the
aspNetEmail.dll, you will need to add the Imports statement (for VB.NET) or the
using statement (for C#), at the top of your page.
Add the following code to the top of your page
[VB.NET]
Imports aspNetEmail
[C#]
using aspNetEmail;
Solution 3: If you are using inline script on your .aspx page,
simply add the aspNetEmail.dll to your /bin directory, and the ASP.NET process
will locate the aspNetEmail.dll.
Solution 4: If you’ve already added the aspNetEmail.dll to the
/bin directory, you will need to add the following Import directive to the top
of the page.
<%@ Import Namespace="aspNetEmail.dll" %>
Solution 5: Some customers are in a hosted environment, and do
not have access to the aspNetEmail.dll, or would rather reference the
aspNetEmail.dll that is installed in the GAC (Global Assembly Cache). To do
this, you will need to add an <assembly> tag to the web.config file.
Locate the <system.web> tag, and add the following entry:(here is a
complete example).
<configuration>
<system.web>
<compilation>
<assemblies>
<add assembly="aspNetEmail, Version=2.0.0.1, Culture=neutral, PublicKeyToken=bc571e8da1c1f543"/>
</assemblies>
</compilation>
</system.web>
</configuration>
Make sure the version and public key token match the properties of the GAC
installed copy. You may need to get this information from your server
administrator. The GAC installed copy can usually be found in
c:\winnt\assembly\
Make sure the <add assembly=".... /> tag is all on one line. If the tag
has any line breaks in it, like
<add assembly="aspNetEmail,
Version=...
Culture=...
/>
This will break the tag, and won't be able to find the aspNetEmail.dll. For
more information on the
tag, view the MSDN documentation here.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfaddelementforassemblies.asp
If none of these solutions work for your, feel free to contact us at
support@aspNetEmail.com . Please include the complete error message you
are seeing.
|
|
|
|
I just purchased aspNetEmail, and
have uninstalled the evaluation version. But when I installed the purchased
version, I get the error:
Unhandled Exception: System.Exception: This 30 day evaluation version of aspNetEmail
(http://www.aspNetEmail.com) has expired.
|
|
Basically, here is what is happening. VS.NET sometimes places a shadow copy of
aspNetEmail to the /bin directories, so even if you uninstall aspNetEmail, a
copy of the dll can still be in the /bin directory. We've also had customers
report that IIS seems to keep a copy of the dlls in memory, and once they've
removed the eval version, and restarted iis, and installed the production
version, the new dll was properly referenced.
Here's a complete checklist for verifying aspNetemail is removed.
Try these following steps
-
If you are using VS.NET, remove any references to aspNetEmail.
-
Try to compile your project, IT SHOULD FAIL. This guarantees it isn't
referencing aspNetEmail.
-
Be sure "Show All Files" is enabled in VS.NET. Check the /bin directory for any
shadow copies of aspNetEmail.
-
If you are using aspNetEmail in IIS, and If possible, shut down IIS (IIS
sometimes keeps a copy of the dlls it references in memory, even after they are
uninstalled).
-
Close down VS.NET.
-
Uninstall aspNetEmail.
-
Check the install directory to verify it has been removed (usually found at
C:\Program Files\AdvancedIntellect\aspNetEmail\ ).
-
If possible, reboot machine (not usually required, but better safe than sorry).
-
Verify the GAC does not have a copy of aspNetEmail (usually found at
c:\winnt\assembly) If a program is referencing the GAC installed copy it will
not be removed until reboot (see previous step). It is recommended you do this
from a command prompt, because windows explorer does not always show all copies
of GAC installed .dlls.
-
If the dll(s) are still there, you may need to remove the dll with the command
line tool gacutil.
From a command prompt, execute:
c:\>gacutil –u aspNetEmail
If you get an error message, you may want to try
c:\>gacutil –uf aspNetEmail
which forces the uninstall.
More information on gacutil, can be found on
MSDN:GacUtil here.
If you see an error messages similar to
Assembly: aspNetEmail , Version=2.5.0.0,
Culture=neutral, PublicKeyToken=bc571e8da1c1f543, Custom=null
Unable to uninstall: assembly is required by one
or more applications
Pending references:
SCHEME:
ID: DESCRIPTION :
Number of items uninstalled = 0
Number of failures = 0
Then, for some unknown reason, according to Microsoft, your registry has been corrupted by the MSI installer process.
You will need to manually remove the references to the installer, from inside the registry. BE SURE TO BACK UP YOUR REGISTRY BEFORE MODIFYING IT.
Using regedit, navigate to the following registry keys, search for aspNetEmail, and delete them.
[HKCU\Software\Microsoft\Installer\Assemblies\Global]
[HKLM\SOFTWARE\Classes\Installer\Assemblies\Global]
A complete article on this topic can be found by one of Microsoft’s team members, Alan Shi,
over here.
If that link is down, we have a local, cached copy, here.
-
If that still doesn’t work, and the assembly is still in the GAC, we still have
another option. You can forcibly delete the assembly, from a command prompt.
From a command prompt, navigate to the Assembly directory (typically
C:\winnt\assembly\gac), and execute the following command
rd /s aspNetEmail
For example C:\winnt\assembly\gac>rd /s
aspNetEmail
This should remove the aspNetEmail directory, and everything below.
-
Install the production version of aspNetEmail.
-
Verify all VS.NET references to aspNetEmail are not broken.
-
Recompile your application.
-
This should fix it. If it doesn't, feel free to contact us using one of the
following options at here.
We recognize this is a problem for both you and us. Therefore, in the near
future we will be switching to external xml licensing files. Currently,
evaluation versions of aspNetEmail have the expiration date hard coded,
internally, to expire. With the new xml licenses, the evaluation version, will
be the same assembly used in production, the only difference, will be the
license file. The evaluation license file, will have the expiration date coded
into it, while the purchased license file, will not expire. We expect this to
go live with version 3.0 of aspNetEmail. If you have any feedback, please
let us know.
|
|
|
|
My email is being truncated at
1000 characters. Also, "?"'s are randomly appearing in the text. What's up with
that?
|
|
This is caused by a strict adherance to RFC 2822 standards. According to the
RFC, no single line should be longer than 1000 characters (actually 998
characters, plus the 2 for the CrLf break). Some of the older gateways and
server strictly enforce this rule, while most of the newer mail server
implementations allow lines longer than 1000 characters. Typically, people will
experiance this problem when sending HTML email, because of long, unbroken HTML
lines. aspNetEmail will automatically handle this, IF you set the
EmailMessage.WordWrapLen property. aspNetEmail will wrap text lines to the
value of WordWrapLen.
What is an acceptable value for WordWrapLen? It should be longer than the
longest word in your email, and no less than 72. If this is an email with long
URLs in it, make sure WordWrapLen is longer than the longest url, so it does
not chop the URL in half.
If you are sending HTML formatted email, it is highly recommended you set the
MailEncoding.QuotedPrintable format for the
EmailMessage.ContentTransferEncoding property. If you set that encoding value,
YOU DO NOT have to set a WordWrapLen. Using the QuotedPrintable format,
aspNetEmail will properly encode the message, and have soft CRLF line breaks
every 72 characters. When the email client decodes the message, the original
line breaks will have been preserved.
|
|
|
|
Why am I getting a
"Unable to locate license file" error (or some other license error)?
|
|
Starting with version 3.0, the license file for aspNetEmail, named
aspNetEmail.xml.lic, is now external to the aspNetEmail.dll. This will allow
the developer to download the latest aspNetEmail.dll, without having to worry
about updates. The license file will work for all major versions in which it
was purchased.
Trial license files can be downloaded at http://www.aspnetemail.com/download.aspx.
Once you have your license file (either trial or purchased), simply add the
aspNetEmail.xml.lic file to your application's /bin directory.
More information about licensing can be found on our licensing
page.
|
|
|
|
unabletolocatelicense