Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API to send e-mails

Status
Not open for further replies.

akyewa

Programmer
Jul 22, 2004
4
ES
Hello!

I need an API that allows me to send emails in any way. Does anyone can help me?

Thanks in advance!!
 
Have you looked at the SmtpMail class that's in the framework?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks!!

I'm going to try it right now, but I don't know if it will work because the thing is that my application runs in a PDA, so I don't know if the PDA will support it :_(

I will keep you informed, thanks again...
 
Have you added the "system.web" reference to your projects and used cdonts?

It doesn't use the Outlook object so you don't need it installed on the machine it's running from.

Here's some example code from one of my apps:

Dim oMsg As New System.Web.Mail.MailMessage
oMsg.From = "a.b@mycompany.co.uk"
oMsg.To = "a.b@yourcompany.com"
oMsg.Subject = "Hi"
oMsg.BodyFormat = System.Web.Mail.MailFormat.Text
oMsg.Body = "My message"
oMsg.Priority = Web.Mail.MailPriority.High
Dim sFile As String = "C:\MyFile.txt"
Dim oAttch As System.Web.Mail.MailAttachment = New System.Web.Mail.MailAttachment(sFile, System.Web.Mail.MailEncoding.Base64)

oMsg.Attachments.Add(oAttch)
System.Web.Mail.SmtpMail.SmtpServer = "192.xxx.x.xx"
System.Web.Mail.SmtpMail.Send(oMsg)

oMsg = Nothing 'clear memory space
oAttch = Nothing

Substitute 192.xxx.x.xx with your mail server IP address and that should work.

Thanks
Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top