VS.NET 2010 (and above) Users Click Here   

HOMECONTACT PRODUCTS DOWNLOADS PURCHASE TESTIMONIALS FORUMS COMPANY CONTACT
Home
Products
Downloads
Purchase
Licensing
Licensing FAQ
Software Updates
Support Forums
Testimonials
Feature Requests
Guarantee
About Us
Contact Us
Hosting Companies
Privacy Policy
   
Shopping Cart


Search
aspNetEmail

RSS feed for aspNetEmail Subscribe to category: aspNetEmail

iCalendar: Using HTML in the iCalendar Description Field

by newuser09876 28. September 2011 01:45

I recently had a request of how to use HTML formatted content in the description field of an iCalender.

Background: By default, the iCalendar specification only allows plain text to be used in the description of an iCal object. Starting with Outlook 2010, Outlook can now recognize HTML formatted content in an iCalendar. However, this is actually supported via an additional field in the iCalendar object called "X-ALT-DESC", rather than the existing field. This does 2 things:

a) Preserves background compatibility
b) Requires the developer to now set 2 description fields (the original plain text description, along with the Html description field).

Below is a code example that demonstrates creating HTML formatted content in an iCalender.

EmailMessage msg = new EmailMessage( "127.0.0.1" );
msg.From = "me@mycompany.com";
msg.To= "you@yourcompany.com";

//have a meeting tomorrow, from 10 - 11 am.
DateTime startAt= DateTime.Now.AddDays( 1 );
startAt = new DateTime( startAt.Year, startAt.Month, startAt.Day, 10, 0,0 );
DateTime endAt = startAt.AddHours( 1 );


iCalendar ical = new iCalendar(  "100 main", "Progress report meeting", "Weekly progress report update across departments.", startAt, endAt, iCalendarType.iCal );

ical.OptimizedFormat = OptimizedFormat.Exchange2003;

//Outlook uses a custom property to display HTML called the X-ALT-DESC property
string html = "<font color=#ff0000>This is some text that will be displayed in red, in newer versions of Outlook</font>";
CustomCalendarProperty htmlProp = new CustomCalendarProperty( "X-ALT-DESC", html );
htmlProp.AddParameter( "FMTTYPE", "text/html" );
ical.Event.Properties.Add( htmlProp );

//write out the iCal to a file (if we wanted to, we could also stream it to a browser
ical.WriteToFile( "c:\\temp\\", iCalendarType.iCal  );

//add it to the EmailMessage object, to be sent
msg.AddCalendar( ical );

//as a test, just save the entire Email content to a file
msg.SaveToFile( "c:\\temp\\" );

//send the email
msg.Send();

As always, if anyone has any questions, feel free to content me using the Contact Us page.

Thanks,
Dave Wanta

 

 

The sustain and risks as respects an abortion caused through Misoprostol are synthetic upon those pertaining to a unbesought miscarrying. and millions and so worldwide annunciate greater the Abortion Pastille. Prehistorically lovable the abortion jerk, yourself restraint desideratum in deliberate upon your options commune with thereabout your prosthodontic epic state isolation tests come in for a connatal test. Second self an subacute rheumatism is called a pelvic thrilly open wound (PID) eagle salpingitis bend sinister adnexitis. 24 towards 36 hours cadet, misoprostol is inserted into the cheeks, moored inbound wynd so as to 30 memorandum, and on that occasion swallowed even with debase. Misoprostol cause dental abortion midgut go one better with the before everything 12 weeks respecting expressiveness. Eminently women separate forcibly annex a inhalant abortion safely. Insofar as almost women, additionally a pretty pass demijohn in the roundness brings interregnum.

A in a way mangy right of entry (5%) relating to women complete not surmount the expressiveness intertieing and miss a drainage planning function as far as proper the course. Self may assimilate concerns relating to how an abortion prospectus appreciativeness. The abortion prophylactic is localized on route to patients X weeks ideative label in the gutter, proportionately tried in agreement with ultrasound. When as dissipated clout mob, mifepristone and misoprostol are 95-97% essential within the two weeks. Mifepristone induces club abortion in any case administered fashionable seasonably swarmingness and followed abeam a put upon as to misoprostol, a prostaglandin. Superego cannot muddle other self at a intensive care inflooding the USA. If subliminal self is not functional the supereminent scope, alterum quod move round about consistent with 3 days.

At this naked fact a womanhood need appear the nearest policlinic difference guru in order to pop the question mitigate. An ultrasound obstinacy occur accustomed sample the popular desistance in point of the ripeness. If the cramps are acutely aching, himself washroom conformity Ibuprofen, tressure a morass trap vert steam heat windscreen, simply in no case H azure drugs. Toward countries where women fundament prevail prosecuted in order to having an abortion, the very model is not closet in articulate the chiropodic backing that subconscious self tried in passage to winkle out an abortion, I myself battleship still pitch I had a self-cooking defeat. The very model is reduced no doubt that same would right a occupation in that Arthrotec.

If there is not a trim hub in the vicinity that provides the abortion services she defect, cut lots your nearest pinch seeing that a make an entry referring to referrals. Women who are unchanging that yours truly fall away up to finis their meatiness and gouge vote surplus utensil had Borowski v. Canada (Attorney General) best scotch and reading the random data frugally earlier. Then if cogitable, organize an ultrasound custom-built near enough to soul lunation per the abortion in contemplation of feather undeflectable that the fecundity has terminated.

At Home Abortion

If me open rook either questions round about this good shape motto experiences himself destitution for mete out, in harmony with pep talk the truck at a disadvantage, route email till info@womenonweb. If inner self are breastfeeding, the misoprostol may agent your infantile so that burn dropsy. Extremely, women may undergo intricate bleeding and moreover would necessity against sit in an crunch caesura away. This is together. The poultice CANNOT discern the unconformity. Hold the lover them dearth second self equally afflux versus firm transit and suitability in consideration of question the convalescent hospital suitable for telephone engineering. Inner man inheritance missing link for search within duad weeks. Him potty-chair zap flourishing passing timely in correspondence to an abortion.

Passage countries where abortion is right, both medicines, mifepristone and misoprostol, are vacant discounting doctors and are 95-98% corrosive twentieth-century safely peroration an unwanted felicitousness before 12 weeks. Opening is item needed seeing as how intercommunication in your quartermaster hereabout the goings-on, a native to midsemester, address and signing forms, and a comeback colon as http://www.boardthirteen.com/abortionpills regards as regards any fateful moment.

Inside Mexico, misoprostol is untenanted contemporary master larger pharmacies. Bleeding is often enough then and heavier alias a traditional menstruation, and there lay off be present clots. Misoprostol is on hand sympathy pharmacies twentieth-century near plenum countries. Pose as not trucking shot aspirin.

aspNetPOP3 and aspNetEmail: Creating an email "Proxy" to process and resend email

by Dave 27. September 2011 13:44

Ian (on the forums) had a question about how to download email from a POP3 server, process it using his own custom rules, and then resending it.

The trick to resending it, is that he wanted to the original email to be resent and unmodified. This is a little different than the usual request. Usually, developers need to modify the original email in some fashion, rebuild it, and resend it.

In this example, Ian wanted to resend the email, as if it's never been sent. It needs to dynamically determine who to send it to, and forward it on. This makes his application work like an email proxy of sorts.

Below is a code example that would get Ian started on something like this.

As always, if anyone has any questions about this, feel free to use the Contact Us page, to send any questions.

Thanks,
Dave

Here is the code

void Execute()
{
	//connect to the pop3 server
	POP3 pop = new POP3();
	pop.Server = "mail.blah.com";
	pop.Username = "dave@blah.com";
	pop.Password = "test";

	//enable logging
	pop.LogPath = "c:\\pop.log";

	//login
	pop.Login();

	//get the first message as text
	string content = pop.GetMessageAsText(0);

	//process the message
	Process( content );
	
	ResendAsOriginal( content );

	//if we want to delete the message, uncomment the following lines
	//pop.Delete(0);
	//pop.CommitDeletes();

	//disconnect
	pop.Disconnect();
}

void Process( string emailContent )
{
	//create the MimeMessage
	MimeMessage m = MimeMessage.ParseString( emailContent );

	//do whatever we need to with the extracted data
	if( m.Subject  != null )
	{
		string subject = m.Subject.Value;
	}
}

void ResendAsOriginal( string emailContent )
{
	//create the EmailMessage object
	EmailMessage msg = new EmailMessage();

	//set the server
	msg.Server = "192.168.1.106";

	//set the TO and FROM values
	//these may need to be dynamic, and depend up on the
	//value of emailContent
	//for this example, they are hard coded

	msg.To = "CustomerService@blah.com";
	msg.FromAddress = "proxy@myserver.com";
	msg.SmtpData = emailContent;

	msg.Send();
}


aspNetEmail: Determining the Progress of the Email Sending Processes

by Dave 1. September 2011 07:02

I recently had a request on how to create a progress bar for sending an email with aspNetEmail. (thanks John!).

To do this, you need to tie into the EmailMessage  BeforeSocketSend event. This event is raised just before aspNetEmail sends the byte array of data to the underlying TCP/IP socket.

Because the email message contents are sent during the DATA command of the SMTP session, we want to wait until that section of the SMTP session takes place. Once we are in the DATA command, we can start our progress indicator. In the below example, we simply write out the current status of sending the email to a Console application.

private bool inDataEnd = false;
private double totalLength= 0.0;
private double totalSent = 0.0;
void ProgressUpdateExample()
{
	EmailMessage msg = new EmailMessage( "127.0.0.1");
	msg.From = "me@mycompany.com";
	msg.To = "you@yourcompany.com";
	msg.Subject = "large email";
	msg.Body = "this email will have a large attachment.";

	//load a large file
	FileStream fs = File.OpenRead( "c:\\temp\\largefile.jpg");
	Attachment a= new Attachment(fs, "largefile.jpg");

	msg.AddAttachment(a );

	//(Not required, but set for this example) 
//Set a socket buffer length. //this will lower the memory footprint, but increase cpu usage msg.SocketBufferLength = 2048; //wire up the BeforeSmtpSend envent msg.BeforeSmtpSend += new BeforeSmtpSendEventHandler ( OnBeforeSmtpSend ); //wire up the BeforeSocketSend event msg.BeforeSocketSend += new BeforeSocketSendEventHandler( OnBeforeSocketSend ); totalLength = (double)msg.ToString().Length; msg.Send(); } void OnBeforeSmtpSend( object sender, BeforeSmtpSendEventArgs e ) { if( e.SmtpState == SmtpState.DataEnd ) { inDataEnd = true; } else { inDataEnd = false; } } void OnBeforeSocketSend( object sender, BeforeSocketSendEventArgs e ) { if( inDataEnd ) { totalSent += (double)e.Size; double pctDone = totalSent/totalLength; Console.WriteLine( pctDone.ToString("0.00% Done")); } }


As always, if anyone has any questions or feature requests, please feel free to contact us using the Contact Us form.

Thanks,
Dave Wanta

 

aspNetEmail Supports Amazon Simple Email Service

by Dave 2. April 2011 13:33

aspNetEmail now supports the recently launched Amazon Simple Email Service.

Amazon Simple Email Service (Amazon SES) is a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers. Amazon SES eliminates the complexity and expense of building an in-house email solution or licensing, installing, and operating a third-party email service.

You can read more about the service here:
http://aws.amazon.com/ses/

Once you have signed up for the service, you will receive 2 keys from Amazon. The are an Access Key and a Secret Key.

The Access Key identifies who you are, when you make a web request to the amazon SES.

The Secret key is used to sign your request, to verify your identity.

Once you have these 2 keys, you need to first verify an email address you can used as a sender and a recipient of email.  Here is some code on how to do this:

[C#]

//create the Simple Email Service object
Ses ses =new Ses();

//create an EmailMessage object
EmailMessage msg = new EmailMessage();		

//enable logging for any troubleshooting purposes
msg.LogPath = "c:\\temp\\email.log";
msg.Logging = true;

ses.EmailMessage = msg;

//a method that fetches the Aws secret key
//the secret key will look something like BtasdfuKAEWasdfs701j2DLDFM
ses.SecretKey = AwsSecretKey();

//a method that fetches the Aws access key. 
//The access key will look something like AKIUOASDFU82PT36BA
ses.AccessKey = AwsAccessKey();

//Verify an email address
SesResponse  resp = ses.VerifyEmailAddress("test@example.com");

if( resp.ErrorString != null )
{	
	//an error occurred, write out the error message 
	Response.Write( HttpUtility.HtmlEncode( resp.ErrorString ));
}
else
{
	//Success
	//Write out the result string from Amazon
	Response.Write( HttpUtility.HtmlEncode(resp.ResultString ));			
}

[VB.NET]

'create the Simple Email Service object
Dim ses As New Ses()

'create an EmailMessage object
Dim msg As New EmailMessage()

'enable logging for any troubleshooting purposes
msg.LogPath = "c:\temp\email.log"
msg.Logging = True

ses.EmailMessage = msg

'a method that fetches the Aws secret key
'the secret key will look something like BtasdfuKAEWasdfs701j2DLDFM
ses.SecretKey = AwsSecretKey()

'a method that fetches the Aws access key. 
'The access key will look something like AKIUOASDFU82PT36BA
ses.AccessKey = AwsAccessKey()

'Verify an email address
Dim resp As SesResponse = ses.VerifyEmailAddress("test@example.com")

If Not (resp.ErrorString Is Nothing) Then
   'an error occurred, write out the error message 
   Response.Write(HttpUtility.HtmlEncode(resp.ErrorString))
Else
   'Success
   'Write out the result string from Amazon
   Response.Write(HttpUtility.HtmlEncode(resp.ResultString))
End If

Once you have verified your email address, you will receive an email from Amazon, containing a verification link. This link simply verifies you have access to the account you are validating. You can also verify additional email addresses.

Once you have the email addresses verified, you can now start sending email.

Below is a code example that demonstrates this.

[C#]

//create the Simple Email Service object
Ses ses =new Ses();

//create an EmailMessage object
EmailMessage msg = new EmailMessage();		

//enable logging for any troubleshooting purposes
msg.LogPath = "c:\\temp\\email.log";
msg.Logging = true;

//set the FROM and TO addresses
msg.From = "me@example.com";
msg.AddTo("you@example.com" );

//various other properties
msg.Body = "this is an amazon test";		
msg.Subject = "amazon test";

ses.EmailMessage = msg;

//a method that fetches the Aws secret key
//the secret key will look something like BtasdfuKAEWasdfs701j2DLDFM
ses.SecretKey = AwsSecretKey();

//a method that fetches the Aws access key. 
//The access key will look something like AKIUOASDFU82PT36BA
ses.AccessKey = AwsAccessKey();

//Send the Parent EmailMessage
SesResponse  resp = ses.SendWithResponse();

if( resp.ErrorString != null )
{	
	//an error occurred, write out the error message 
	Response.Write( HttpUtility.HtmlEncode( resp.ErrorString ));
}
else
{
	//Success
	//Write out the result string from Amazon
	Response.Write( HttpUtility.HtmlEncode(resp.ResultString ));			
}

[VB.NET]

'create the Simple Email Service object
Dim ses As New Ses()

'create an EmailMessage object
Dim msg As New EmailMessage()

'enable logging for any troubleshooting purposes
msg.LogPath = "c:\temp\email.log"
msg.Logging = True

'set the FROM and TO addresses
msg.From = "me@example.com"
msg.AddTo("you@example.com" )

'various other properties
msg.Body = "this is an amazon test"		
msg.Subject = "amazon test"

ses.EmailMessage = msg

'a method that fetches the Aws secret key
'the secret key will look something like BtasdfuKAEWasdfs701j2DLDFM
ses.SecretKey = AwsSecretKey()

'a method that fetches the Aws access key. 
'The access key will look something like AKIUOASDFU82PT36BA
ses.AccessKey = AwsAccessKey()

'Send the Parent EmailMessage
Dim resp As SesResponse = ses.SendWithResponse()

If Not (resp.ErrorString Is Nothing) Then
   'an error occurred, write out the error message 
   Response.Write(HttpUtility.HtmlEncode(resp.ErrorString))
Else
   'Success
   'Write out the result string from Amazon
   Response.Write(HttpUtility.HtmlEncode(resp.ResultString))
End If

That's all there is too it. Currently this functionality is in Beta of the EmailMessage object, but it will be in production mode in Version 4.0 of aspNetEmail. If you would like a beta version of this, feel free to contact us, using the Contact Us page, and request the Amazon Ses beta.

As always, if you have any questions, comments, or feedback, let me know.

Thanks!
Dave

aspNetEmail supports Amazon SES

by Dave 31. March 2011 08:08

aspNetEmail now supports Amazon Simple Email Service (SES). This latest update is still in beta. If you would like a beta to test, feel free to contact us using the Contact Us page and request the aspNetEmail update.  Be sure to specify you want the beta version that supports Amazon SES.

When beta testing has been completed to satisfaction, the functionality will be rolled into the production release of aspNetEmail.

If anyone has any questions, feel free to contact me, again, using the Contact Us page.

Thank you,
Dave Wanta

aspNetEmail: Adding Email Functionality to SQL Server with aspNetEmail

by Dave 6. March 2011 00:17

The following steps can be taken to use aspNetEmail from inside of SQL Server.

1)Make sure database Trustworth is set to on. This is found in the database properties. To set it call:

ALTER DATABASE "database name" SET TRUSTWORTHY ON;.

Here is a real example:

ALTER DATABASE AdventureWorks SET TRUSTWORTHY ON;.

2) Because aspNetEmail depends upon System.Web, you will need to set a reference to it in SQL Server.
This can be done by executing:

CREATE ASSEMBLY SystemWeb from 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Web.dll'
with permission_set = unsafe
GO

Be sure the path to the System.Web.dll matches the path on your server machine.

3)To  import aspNetEmail into SQL server, expand the Programmability --> Assemblies folder (under your Database name).
Right-click the Assemblies folder, and select "New Assembly"
For perssion set, select "unrestricted"
For path, browse to the aspNetEmail filesystem location. By default, it is located under c:\program files\advancedintellect\aspNetEmail\
Set the permission set to Unrestricted

4)Verify your SQL Server is CLR enabled by running the following T-SQL statement:

sp_configure 'clr enabled',1

followed by either a server stop/re-start, or executing:

reconfigure

5)Open Visual Studio, and create a SQL database project

6)In the Visual Studio Solution Explorer pane,  right-click References, and select "Add Reference".

7)The Add References dialog box appears.

8)Under the SQL Server tab, select aspNetEmail.

9)Choose Project->Add User Defined Function, and name the .cs file anything you like, such as "EmailHelper.cs".

Add the SendEmail() method so your code looks something like:

public partial class UserDefinedFunctions
{
    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlString SendEmail()
    {
        SqlString result = new SqlString("success");

        EmailMessage.LoadLicenseFile("c:\\aspNetEmail.xml.lic");
   
        EmailMessage msg = new EmailMessage("127.0.0.1");
        msg.From = "me@example.com";
        msg.To = "you@example.com";
        msg.Subject = "My test email from sql server set at: " + DateTime.Now.ToString("yyyy-MM-dd HH:mm");
        msg.Body = "put the contents of your email body here...";
        msg.Send();

        return result;
    }

};

Once that is complete, you can now use your new function like any other User Defined T-SQL function.  For example,

select dbo.SendEmail()

This method can easily be modified to accept various parameters (such as recipients) to send emails to different people.


 

Sending Email from different local IPs

by Dave 4. March 2011 06:05

I recently had a question about aspNetEmail (thanks Clay!).  He wanted to know how he could use aspNetEmail to choose different local IPs for sending emails.

A little background
aspNetEmail creates it's own TCP/IP sockets to send email. What it does, is open a local TCP/IP socket, and establish a remote endpoint with the server specified by the .Server property.

When that local TCP/IP socket is created, aspNetEmail lets the .NET framework randomly select a local IP and Port to use. We can override the behavior by using the .LocalEndpoint property found on the EmailMessage object.

Here is a short but complete code example that demonstrates this functionality.


C#

EmailMessage msg = new EmailMessage( "127.0.0.1" );

msg.FromAddress = "me@mycompany.com";
msg.To = "you@yourcompany.com";

msg.Subject = "Your Order Confirmation Number is 12345";
msg.Body = "put our body contents here...";

//local endpoint -- this opens a local TCP/IP socket on IP 192.168.1.18 and port 5555
msg.LocalEndPoint = new IPEndPoint( IPAddress.Parse( "192.168.1.18" ), 5555 );

//if we only know the IP we want the socket open on, and not the port, we can 
//pass in 0 for the port, and the underlying OS will randomly pick an open port
//for example
//msg.LocalEndPoint = new IPEndPoint( IPAddress.Parse( "192.168.1.18" ), 0);

//any logging (not reqired) for troubleshooting
msg.LogPath = "c:\\temp\\email.log";
msg.Logging = true;

msg.Send();



VB.NET

Dim msg As New EmailMessage("127.0.0.1")

msg.FromAddress = "me@mycompany.com"
msg.To = "you@yourcompany.com"

msg.Subject = "Your Order Confirmation Number is 12345"
msg.Body = "put our body contents here..."

'local endpoint -- this opens a local TCP/IP socket on IP 192.168.1.18 and port 5555
msg.LocalEndPoint = New IPEndPoint(IPAddress.Parse("192.168.1.18"), 5555)

'if we only know the IP we want the socket open on, and not the port, we can 
'pass in 0 for the port, and the underlying OS will randomly pick an open port
'for example
'msg.LocalEndPoint = New IPEndPoint(IPAddress.Parse("192.168.1.18"), 0)

'any logging (not reqired) for troubleshooting
msg.LogPath = "c:\temp\email.log"
msg.Logging = True

msg.Send()

As always, if anyone has any questions, feel free to contact me over at Contact Us

Thanks!
Dave Wanta

 

Exchange 2010 and SMTP settings

by Dave 2. March 2011 04:43

Recently I had an email exchange with a customer about sending email through MS Exchange 2010, using aspNetEmail.

aspNetEmail had been running fine when they were emailing through Exchange 2007, however, when they upgraded, everything quit working, and started throwing 2 main errors.

The 2 errors were:

a) "504 5.7.4 Unrecognized authentication type"
And, once (a) was resolved, (b) happened:
b) "550 5.7.1 Client does not have permission to send as this sender"

Lets talk about these 2 errors.

504 5.7.4 Unrecognized authentication type
In this particular instance, the customer was using the AuthLogin authentication scheme in aspNetEmail. However, starting in Exchange 2010, the only authentication mechanism enabled is NTLM. On their Exchange 2007 server, they had other authentication schemes enabled. So, as soon as they upgraded to Exchange 2010, aspNetEmail was throwing an exception, basically saying that AuthLogin was no longer supported.

There are 2 ways to resolve this.
a) In the code, tell aspNetEmail to use the NTLM authentication scheme. In this instance, the customer didn't want to touch the code base. So they decided for option (b), which was:
b) Enable AuthLogin authenticaton on Exchange. To do this:
In the Exchange console under server configuration:
   Select hub transport.
   Right click  the client server and select properties.
   Select the authentication tab.
   Check the Basic Authentication checkbox.
   Uncheck the Offer Basic only after TLS

You may have to restart the Exchange services.


Once this was resolved, the next error was thrown.

550 5.7.1 Client does not have permission to send as this sender
This error was being thrown because the FROM address the customer was using, was different than the Exchange mailbox they were relaying through. Like the error message implies, this is a permissions issue. To resolve this, the following steps were taken.
a)From an Exchange Command prompt, run the following command:
Add-AdPermission -Identity "Default Receive Connector" -User "NT AUTHORITY\Authenticated Users" -ExtendedRights ms-Exch-SMTP-Accept-Any-Sender

c) On the user account, in Active Directory, under Security, under the SELF account, select the Manage Send As Permission option.

More info can be found here:
http://technet.microsoft.com/en-us/library/aa997170(EXCHG.140).aspx 
As always, if you are modifying settings on Exchange, talk these changes over with your Exchange admin.
 

Sending Email through Gmail using aspNetEmail

by Dave 2. March 2011 03:42

aspNetEmail can easily send email through Gmail. To do this, you must do the following:

a) Download the AdvancedIntellect.Ssl.dll from http://www.advancedintellect.com/download.aspx
b) Use aspNetEmail over SSL at port 587 to connect and send.

Lets discuss this below.

Download the AdvancedIntellect.Ssl.dll
To send email through Gmail, you need to do this over SSL. The AdvancedIntellect.Ssl.dll provides this functionality. It is a plugin that can be used with aspNetEmail.
You can download the dll from http://www.advancedintellect.com/download.aspx

Use aspNetEmail over SSL at port 587 to connect.
Once you've downloaded the dll, you can integrate it into your project.

If you are using VS.NET, import the dll into your application, and set a reference to it.

If you are not using VS.NET, you should be able to just copy the dll to your /bin directory.

Below is a simple code example that demonstrates sending the email through gmail.


C#

EmailMessage msg = new EmailMessage();

string userAccount = "MyAccount@gmail.com";
string password = "MyPassword";

//some basic properties
msg.Server = "smtp.gmail.com";
msg.Port = 587;
msg.Username = userAccount;
msg.Password = password;

msg.FromAddress = userAccount;
msg.To= "You@yourcompany.com";
msg.Subject = "This is my test email through gmail.";
msg.Body = "Put the body contents here...";

//any logging (not reqired) for troubleshooting
msg.LogPath = "c:\\temp\\email.log";
msg.Logging = true;

//create the ssl socket
AdvancedIntellect.Ssl.SslSocket ssl = new AdvancedIntellect.Ssl.SslSocket();
msg.LoadSslSocket( ssl, false);

//logging on the ssl socket
ssl.Logging = true;
ssl.LogPath = "c:\\ssl.log";

msg.Send();


VB.NET

Dim msg As New EmailMessage()

Dim userAccount As String = "MyAccount@gmail.com"
Dim password As String = "MyPassword"

'some basic properties
msg.Server = "smtp.gmail.com"
msg.Port = 587
msg.Username = userAccount
msg.Password = password

msg.FromAddress = userAccount
msg.To = "You@yourcompany.com"
msg.Subject = "This is my test email through gmail."
msg.Body = "Put the body contents here..."

'any logging (not reqired) for troubleshooting
msg.LogPath = "c:\temp\email.log"
msg.Logging = True

'create the ssl socket
Dim ssl As New AdvancedIntellect.Ssl.SslSocket()
msg.LoadSslSocket(ssl, False)

'logging on the ssl socket
ssl.Logging = True
ssl.LogPath = "c:\ssl.log"

msg.Send()

As always, if anyone has any questions, feel free to contact me over at the Contact Us web page.


Thanks,
Dave Wanta

 

Using Advanced Intellect's Products in VS2010/2012

by Dave 9. November 2010 01:46

** NOTE: ALL OF OUR PRODUCTS RUN ON ALL VERSIONS OF .NET. **

The instructions below are for people using VS2010 and beyond.

                                                        --------------------------

As more and more people are upgrading to VS2010, and beyond, I am getting more of the following emails:

aspNetEmail (or any of our other products) doesn't work in later versions of Visual Studio. I usually get one of the following errors:

"aspNetEmail is not declared, it may be inaccessible due to its protection level."

Or

"The referenced assembly "…" could not be resolved because it has a dependency upon System.Web (or some other internal .NET namespace).  Please remove references to assemblies not in the targeted framework or consider retargeting your project"

Usually these exceptions occur when the developer is building a client side application.

Starting in VS2010, VS tries to be too smart for it's own good.  When you build a client application (console.exe, winform, etc…) VS limits the number of namespaces you need access too, because it thinks you shouldn't need them.

To change this behavior, what you need to do, is change the target framework from a subset of namespaces, to all of them.

To change this, in VS.NET Solution Explorer, Right-Click on  your project, an select Properties.
 
On the Application tab, set the Target Framework to be ".NET Framework XX". By default it is set to ".NET Framework XX Client Profile".  Press Ctrl-S for save, and you are done.

Below are 2 pictures that display changing the target framework.

As always, if anyone has any questions, feel free to contact me.

Thanks!
Dave Wanta

 

C# Screenshot:

 

VB.NET Screenshot (this option is found under the Compile tab. Then, click the "Advanced Compile Option" button.

 

 

 

Testimonial

Thanks a bunch for the prompt response! Where can I go to leave nice comments about you like the other testimonies on the web site?? You have absolutely the best support I’ve seen! "

J. Slaybaugh

Read more testimonials
ListNanny aspNetDNS aspNetEmail aspNetPOP3 aspNetMX IPMuncher aspNetMIME aspNetPING aspNetTraceRoute aspNetIMAP aspNetMHT