473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

send email? only with smtp and/or exchange?

Hi guys!

I'm looking for a way to send an email from the server to the user
(like a newsletter).

How can I do this?

Does anyone know of a sample code link or something like that?

Do I need smtp and or ms exchange or there is a way to send using any 'from' name
(like in php)?

Thanks in advance!
Mar 15 '07 #1
1 946
beanr
3
Dim lmsMail As New MailMessage()
Dim lsMailFrom As String = msMailFrom
Dim lsMailTo As String = lsEmailAddress

'set the addresses
lmsMail.From = New MailAddress(lsMailFrom)
lmsMail.To.Add(lsMailTo)

'set the attachment
Dim loFile As New System.Net.Mail.Attachment(lsPath)
loFile.Name = lsFileName

lmsMail.Attachments.Add(loFile)

'set the content
lmsMail.Subject = lsEmailSubject

Dim lsEmailString As String = "<HTML><BODY>Please Do Not Reply To This Email!<BR><BR>"

lsEmailString &= "This E-mail was generated from <BR>If you no longer wish to receive these </HTML></BODY>"

Dim htmlView As AlternateView = AlternateView.CreateAlternateViewFromString(lsEmai lString, Nothing, "text/html")

lmsMail.AlternateViews.Add(htmlView)

If lsEmailServerUser <> "" Then
loMailApp.UseDefaultCredentials = False
loMailApp.Credentials = New Net.NetworkCredential(lsEmailServerUser, lsEmailServerPass, lsEmailServer)
End If

loMailApp.Send(lmsMail)
Mar 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
3
by: icsupt via AccessMonster.com | last post by:
I would like to send an email from Access. I copied the code from another free website, but it does not do everything I need it to do. I have a series of checkboxes: checkbox1 - when checked,...
0
by: Just D. | last post by:
All, Is there a simple way to send a plain email message via MS Exchange server? I know that it's pretty easy to send a message via SMTP using a standard ..NET library, but what about M$...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
1
by: michi | last post by:
Hi there.... Got here a tricky thing with my SMTP. First I show you what works on my machine.. **This Works** SmtpMail.SmtpServer = "mail.gmx.net" <-gmx is my mail provider...
3
by: Luiz Vianna | last post by:
Guys, I have a Windows 2003 running Exchange 2003. On this machine I'm trying to run an ASP.NET webform to send an e-mail. The codebehing my ASPX is like this: Dim NewMail As New...
1
by: Nigel | last post by:
I know there are lots of threads covering my question but i am still unable to send e-mails from an asp.net page. Messages are not even going into the logs. Here is the code that i am using to...
3
by: frank | last post by:
I need help please! I write a method to send email and there is a button on a web page, click the button will call the method. everything seems ok. but the email never be sent....
0
by: Atenza | last post by:
Hi all, I develop an VB6 program to send email by using CDOSYS.DLL. It works fine as follow: Dim iMsg As New CDO.Message Dim iDsrc As CDO.IDataSource Set iDsrc = iMsg ' (QueryInterface)...
7
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi guys! I'm looking for a way to send an email from the server to the user (like a newsletter). How can I do this? Does anyone know of a sample code link or something like that? Do I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.