Overview (Email Sender)
GetAccounts (Email Sender)
New1 (Email Sender)
Send (Email Sender)
AddAttachment (Email Message)
AddCC (Email Message)
AddTo (Email Message)
BodyText (Email Message)
New1 (Email Message)
Subject (Email Message)
Value (Email Message)
Overview (Email Sender) Top
The Email library uses Pocket Outlook to send email messages.
The messages are sent using one of the existing accounts.
When you send a message the message is actually added to the Outbox folder. If there is a valid connection the message is sent, otherwise the message will stay in the Outbox folder until a connection is created.
This feature is useful in cases where the device is not always connected.
The Email library will only work on Windows Mobile 5 and Windows Mobile 6 devices and it requires .Net CF 2.0.
The EmailDesktop library is a "dummy" library and its only use is to allow you to write applications on the desktop. The methods will do nothing.
The library includes two objects: EmailSender object which includes a list of the available accounts and allows sending the messages and Message object which represents an email message.
Example:
'EmailSender is an EmailSender object and Message is a Message object.
Sub Globals
Dim accounts(0) as String
End Sub
Sub App_Start
Form1.Show
EmailSender.New1
Accounts() = EmailSender.GetAccounts 'Returns the names of all the accounts.
s = "Accounts list: "
For i = 0 to ArrayLen(Accounts()) - 1
s = s & crlf & Accounts(i)
Next
Msgbox(s)
Message.New1
Message.Subject = "Hello World!!!"
Message.AddTo("ToEmail@abc.def") 'Adds an address to the "To" field.
Message.AddAttachment(AppPath & "\some file.txt") 'Adds an attachment.
EmailSender.Send("Form1",accounts(0),Message.Value) 'Sends the message using the first account.
End Sub
GetAccounts (Email Sender) Top
Returns an array of strings representing the accounts names.
Syntax: GetAccounts
Example:
Sub Globals
Dim accounts(0) as String
End Sub
Sub App_Start
EmailSender.New1
Accounts() = EmailSender.GetAccounts
End Sub
New1 (Email Sender) Top
Initializes the EmailSender object.
Syntax: New1
Send (Email Sender)
Top
Adds the email message to the Outbox folder and tries to send it.
Syntax: Send (Form As Control, Account As String, Message As Object)
Form - The name of the form that will be shown after the message is sent. Usually it is the same form as the one that was previously shown.
Account - The name of the account to use to send the message.
Message - The message object.
Example:
EmailSender.Send("Form1","POP3",Message.Value)
AddAttachment (Email Message) Top
Adds a file as an attachment to the message.
More than one file can be attached in one message.
Syntax: AddAttachment (File As String)
Example:
Message.AddAttachment(AppPath & "\some file.txt")
AddCC (Email Message) Top
Adds an address to the 'CC' field.
Syntax: AddCC (Address As String)
Example:
Message.AddCC ("abc@def.com")
AddTo (Email Message) Top
Adds an address to the 'To' field.
Syntax: AddTo(Address As String)
Example:
Message.AddTo ("abc@def.com")
BodyText (Email Message) Top
Gets or sets the message's body text.
Syntax: BodyText
Example:
Message.BodyText = "Hi," & crlf & "Have a great day :)"
New1 (Email Message) Top
Initializes a Message object.
Syntax: New1
Subject (Email Message) Top
Gets or sets the message's subject text.
Syntax: Subject
Example:
Message.Subject = "Very important message"
Value (Email Message) Top
Gets a reference to the Message object.
Syntax: Value
Example:
EmailSender.Send("Form1",accounts(0),Message.Value)