Posted by dotnetprograming on June 26, 2009
‘ Create a mailman object for sending email.
Dim mailman As New Chilkat.MailMan()
‘ Any string passed to UnlockComponent automatically begins a 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent(“Hello World”)
If (success true) Then
MsgBox(mailman.LastErrorText)
Exit Sub
End If
‘ Set the SMTP server.
mailman.SmtpHost = “smtp.earthlink.net”
‘ Create an email with multiple BCC recipients.
Dim email As New Chilkat.Email()
‘ Set the basic email stuff: body, subject, “from”, “to”
email.Body = “This is the email body”
email.Subject = “This is the email subject”
email.AddTo(“Chilkat Support”, “support@chilkatsoft.com”)
email.From = “Programmer “
‘ To add multiple BCC recipients, you can call AddBcc multiple times
‘ and/or call AddMultipleBcc with a comma-separated list of email addresses.
‘ Either method can be called any number of times. Chilkat automatically
‘ removes duplicates.
email.AddBcc(“”, “sales@chilkatsoft.com”)
email.AddBcc(“Chilkat HR”, “hr@chilkatsof.com”)
email.AddMultipleBcc(“Jack Frost , matt@chilkatsoft.com, Bob “)
success = mailman.SendEmail(email)
If success Then
MessageBox.Show(“Sent BCC email!”)
Else
MessageBox.Show(mailman.LastErrorText)
End If
Posted in EMail | Leave a Comment »
Posted by dotnetprograming on June 26, 2009
‘ Create a mailman object for sending email.
Dim mailman As New Chilkat.MailMan()
‘ Any string passed to UnlockComponent automatically begins a 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent(“Hello World”)
If (success true) Then
MsgBox(mailman.LastErrorText)
Exit Sub
End If
‘ Set the SMTP server.
mailman.SmtpHost = “smtp.earthlink.net”
‘ Create an email with multiple CC recipients.
Dim email As New Chilkat.Email()
‘ Set the basic email stuff: body, subject, “from”, “to”
email.Body = “This is the email body”
email.Subject = “This is the email subject”
email.AddTo(“Chilkat Support”, “support@chilkatsoft.com”)
email.From = “Programmer “
‘ To add multiple CC recipients, you can call AddCC multiple times
‘ and/or call AddMultipleCC with a comma-separated list of email addresses.
‘ Either method can be called any number of times. Chilkat automatically
‘ removes duplicates.
email.AddCC(“”, “sales@chilkatsoft.com”)
email.AddCC(“Chilkat HR”, “hr@chilkatsof.com”)
email.AddMultipleCC(“Jack Frost , matt@chilkatsoft.com, Bob “)
‘ If you are curious, look at the full MIME text of the email…
MessageBox.Show(email.GetMime())
success = mailman.SendEmail(email)
If success Then
MessageBox.Show(“Sent email!”)
Else
MessageBox.Show(mailman.LastErrorText)
End If
Posted in EMail | Leave a Comment »
Posted by dotnetprograming on June 26, 2009
‘ Create a mailman object for sending email.
Dim mailman As New Chilkat.MailMan()
‘ Any string passed to UnlockComponent automatically begins a 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent(“Hello World”)
If (success true) Then
MsgBox(mailman.LastErrorText)
Exit Sub
End If
‘ Set the SMTP server host.
mailman.SmtpHost = “smtp.earthlink.net”
‘ Create a simple email with file attachments.
Dim email As New Chilkat.Email()
‘ This email will have both a plain-text body and an HTML body.
email.Body = “This is the plain-text alternative”
email.AddHtmlAlternativeBody(“This is bold red text.“)
email.Subject = “This email has several file attachments.”
email.AddTo(“Chilkat Support”, “support@chilkatsoft.com”)
email.From = “Hello World “
‘ Add a file attachment.
Dim contentType As String
‘ Returns the content-type of the attachment (determined by the file extension)
‘ This return value is for informational purposes only.
contentType = email.AddFileAttachment(“dude.gif”)
If contentType Is Nothing Then
MessageBox.Show(email.LastErrorText)
Return
End If
‘ To add more attachments, simply call AddFileAttachment for each file to be added.
contentType = email.AddFileAttachment(“dude2.gif”)
If contentType Is Nothing Then
MessageBox.Show(email.LastErrorText)
Return
End If
‘ Send email.
success = mailman.SendEmail(email)
If success Then
MessageBox.Show(“Sent email with attachments!”)
Else
MessageBox.Show(mailman.LastErrorText)
End If
Posted in EMail | Leave a Comment »
Posted by dotnetprograming on June 26, 2009
‘ Create a mailman object for sending email.
Dim mailman As New Chilkat.MailMan()
‘ Any string passed to UnlockComponent automatically begins a 30-day trial.
Dim success As Boolean
success = mailman.UnlockComponent(“Hello World”)
If (success true) Then
MsgBox(mailman.LastErrorText)
Exit Sub
End If
‘ Set the SMTP server hostname.
mailman.SmtpHost = “smtp.earthlink.net”
‘ Create a simple HTML mail.
Dim email As New Chilkat.Email()
email.SetHtmlBody(“This is red bold text“)
email.Subject = “This is a simple HTML email”
email.AddTo(“Chilkat Support”, “support@chilkatsoft.com”)
email.From = “Jack Johnson “
‘ Send HTML mail.
success = mailman.SendEmail(email)
If success Then
MessageBox.Show(“Sent mail!”)
Else
MessageBox.Show(mailman.LastErrorText)
End If
Posted in EMail | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
ASP.NET has built in controls that enable incredibly easy validation creation. By using different validator controls and ValidationSummary control even a complex validation process can be done very fast. You can just drag and drop validation controls to the form, map them to form fields and you have a client-side validation. Creating server side validation is simple as well. You can use C# or VB.NET to perform even the extremely complex validation process.
Available validation server controls
Validation Server Control
RequiredFieldValidator
Ensures that the user does not skip a form entry field
CompareValidator
Allows for comparisons between the user’s input and another item using a comparison operator (equals, greater than, less than, and so on)
RangeValidator
Checks the user’s input based upon a lower- and upper-level range of numbers or characters
RegularExpressionValidator
Checks that the user’s entry matches a pattern defined by a regular expression. This is a good control to use to check e-mail addresses and phone numbers
CustomValidator
Checks the user’s entry using custom-coded validation logic
ValidationSummary
Displays all the error messages from the validators in one specific spot on the page
Posted in Validation Controls | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
The final control we have included in ASP.NET is one that adds great flexibility to our validation abilities. We have a custom validator where we get to write out own functions and pass the control value to this function.
Field:
*
>
We notice that there are two new attributes ClientValidationFunction and OnServerValidate. These are the tell the validation control which functions to pass the controltovalidate value to. ClientValidationFunction is usually a javascript funtion included in the html to the user. OnServerValidate is the function that is server-side to check for validation if client does not support client-side validation.
Client Validation function:
<script language=”Javascript”>
>
Server Validation function:
Sub ServerValidate (objSource As Object, objArgs As ServerValidateEventsArgs)
‘ Code goes here
End Sub
b
Posted in Validation Controls | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
The regular expression validator is one of the more powerful features of ASP.NET. Everyone loves regular expressions. Especially when you write those really big nasty ones… and then a few days later, look at it and say to yourself. What does this do?
Again, the simple usage is:
E-mail:
*
>
Posted in Validation Controls | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
Range validator control is another validator control which checks to see if a control value is within a valid range. The attributes that are necessary to this control are: MaximumValue, MinimumValue, and Type.
Sample:
Enter a date from 1998:
*
>
Posted in Validation Controls | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
Next we look at the CompareValidator Control. Usage of this CompareValidator is for confirming new passwords, checking if a departure date is before the arrival date, etc. We’ll start of with a sample:
Textbox 1:
Textbox 2:
*
>
Here we have a sample where the two textboxes must be equal. The tags that are unique to this control is the ControlToCompare attribute which is the control that will be compared. The two controls are compared with the type of comparison specified in the Operator attribute. The Operator attribute can contain Equal, GreterThan, LessThanOrEqual, etc.
Another usage of the ComapareValidator is to have a control compare to a value. For example:
Field:
*
>
The data type can be one of: Currency, Double, Date, Integer or String. String being the default data type.
Posted in Validation Controls | Leave a Comment »
Posted by dotnetprograming on April 29, 2009
The first control we have is the RequiredFieldValidation Control. As it’s obvious, it make sure that a user inputs a value. Here is how it’s used:
Required field:
*
>
In this example, we have a textbox which will not be valid until the user types something in. Inside the validator tag, we have a single *. The text in the innerhtml will be shown in the controltovalidate if the control is not valid. It should be noted that the ErrorMessage attribute is not what is shown. The ErrorMessage tag is shown in the Validation Summary (see below).
Posted in Asp.Net | Leave a Comment »