|
This is for VS 2003 and it looks like it has changed for VS2005. Here is some code to get you started. Look on MSDN for more class documentation.
Dim email As New System.Web.Mail.MailMessage<br />
Dim EmailSrv As System.Web.Mail.SmtpMail<br />
email.To = "youremail@yourcompany.com"<br />
email.From = "youremail@yourcompany.com"<br />
email.BodyFormat = Web.Mail.MailFormat.Html<br />
email.Body = "Testing"<br />
email.Subject = "Test Email"<br />
EmailSrv.SmtpServer = "email.yourcompany.com"<br />
EmailSrv.Send(email)
|
|
|
|
|
For VS2005, use the System.Net.Mail namespace instead. The System.Web.Mail namespace has been deprecated.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Does this approach require a Mail Server running on the same machine as the application?
|
|
|
|
|
No. You supply the DNS name or IP address of a valid SMTP server to the SmtpClient[^] class.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the answer. But my development platform is vb 6.0 and not VB.Net
Thanks,
Pasha
|
|
|
|
|
You should have mentioned that in the original post. VB.NET is usually assumed if nothing is said about which version you're using.
You can use the MAPISession[^] and MAPIMessages[^] ActiveX controls to do this. I don't have any example code on how to use them though. A simple Google for "vb6 mapisession mapimessages" reveals this[^] list of possibilities.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi All,
How to insert the embeded document(MS Excel/pdf) in WordML(MS Word2003)?
Thanks inadvance.
|
|
|
|
|
Hi !
First time web application. Application looks and works ok when debugging. Do I need to build it somehow or what should I do next to get it working in WWW. I have a webhotel service. But what do I copy there... I have VB.NET 2003 std version with Win XP pro.
|
|
|
|
|
Look at this links for information on deploying ASP.NET 1.1 applications.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hi,
I am writing a windows app, and in the function I need to check and see if a variable (email), is a valid email address. I know how to use the one in the aspx pages, but as I am new to windows apps, I am struggling.
my variable is called "strEmailAdd"
How can I pass this to a regular expression, and check if it is valid. If valid, return "Y", else return "N"?
|
|
|
|
|
Hi,
Here is an article which explains email validations using Regular expressions.
Email validations using Regular Expressions.
dim reg as Regex = new Regex(@"^[a-zA-Z'.]{1,40}$")
Response.Write(reg.IsMatch(txtName.Text))
if (!Regex.IsMatch(txtName.Text,
@"^[a-zA-Z'.]{1,40}$")) Then
end if
This is a simple example from msdn. Change the regex according to the article i suggested in the link provided.
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
Thanks, this definitly helps me!
|
|
|
|
|
i set a picturebox control on my form and i load an image to it from the image property , i also set the Visible property to "True" but when i debug the application , i can't see the image in the run mode, only the border of the picturebox. The extention of the image is "JPG" and "Gif" , and i can open those pictuers easly as i'm using windows XP, but i still can't see the picture on the run mode. is there a code i should use to load the image in the picturebox at run time , and if yes where to place this code, in the main code body of the form or behind the picturebox itself. please advise and thank you again
i could found a possible code which is
< Dim img As Image
img = picturebox1.image >
but when i use it i have an errore which state that Image is not a type.
please advise and thank you.
Ali
|
|
|
|
|
You can use given command to load picture at run time
Dim bmp As New System.Drawing.Bitmap(FileName)
PictureBox1.Image = bmp
Thanks & Regards
Kumar Prabhakar
abc
|
|
|
|
|
Thank you so much, this was really helpful and solve the problem but the point now is , when i place the path for the image in the code. i can't run this application on any ther machine also when adding the setup wizard to the solution i added the image within this wizard. but when i tried to run the application on another machine after installing it, the application didn't work,
so how i can over come this problem, please Advise and thanks for your help
Ali
|
|
|
|
|
how do i filter the report between 2 dates and/or 1 item code as report is already designed!
susmita
|
|
|
|
|
You have to create parameter for report that parameter will be assigned at run time.
Thanks & Regards
Kumar Prabhakar
kumar Prabhakar
|
|
|
|
|
Hi
you can use the record selection formula to specify your filter
Kanniah
|
|
|
|
|
HI,
how can i get the index of the selected item in the combobox in a column of the dataGridView?
thanks,
regards
|
|
|
|
|
check out this code
aspx page
asp:datagrid id="Datag" runat="server" Width="100%" AutoGenerateColumns="False" PageSize="10"
asp:TemplateColumn HeaderText="Dropdown test"
ItemTemplate
asp:DropDownList id="DropdownAction" AutoPostBack="True" OnSelectedIndexChanged="DdAction_SelectedIndexChanged" Runat="server"
Code behind file (.cs)
public void DdAction_SelectedIndexChanged(object sender, System.EventArgs e)
{
DropDownList list = (DropDownList)sender;
if (list.SelectedIndex == 0)
{
//Actions for item 1
}
else if (list.SelectedIndex == 1)
{
//Actions for item 2
}
}
Navi
|
|
|
|
|
i set a picturebox control on my form and i load an image to it from the image property , i also set the Visible property to "True" but when i debug the application , i can't see the image in the run mode, only the border of the picturebox. Please Advise
Ali
|
|
|
|
|
Hi!
check the extension for your image, maybe it's not supported on your machine. You may need plugins to see some pictures. Cheers!
Regards,
Hesbon.
|
|
|
|
|
The extention is "JPG" and "Gif" , and i can open those pictuers easly as i'm using windows XP, but i still can't see the picture on the run mode. is there a code i should to load the image in the picturebox at run time , and if yes where to place this code, in the main code body of the form or behind the picturebox itself. please advise and thank you again
Ali
|
|
|
|
|
hi
try to resize the picturebox
Tamimi - Code
|
|
|
|
|
Hello,
I'm trying this code written in VB Script and its returning 0 records, inspite there are records. When I query the index server directly, I get records, but with this code i get 0 records. Can someone help?
Thanks in anticipation,
Rakesh
Dim ixQuery ' Index Server query object.
Set ixQuery = CreateObject("ixsso.Query")
If (Err.Description <> "") Then
MsgBox err.Description
End If
ixQuery.Columns = "filename,rank"
ixQuery.SortBy = "rank[d]"
ixQuery.Query = "Agreement"
ixQuery.Maxrecords = 1000
ixQuery.Catalog = "query://coiw2ptidbdev/system"
Dim util
Set util = CreateObject("ixsso.Util")
util.AddScopeToQuery ixQuery, "/", "deep"
If (Err.Description <> "") Then
MsgBox err.Description
End If
' Run the query (i.e. create the recordset).
Dim queryRS
'Set queryRS = CreateObject("ADODB.Recordset")
Set queryRS = ixQuery.CreateRecordSet("nonsequential")
' Check the query result. If it timed out or return no records, then show
' an appropriate message. Otherwise, show the hits.
If (Err.Description <> "") Then
MsgBox err.Description
Else
If queryRS Is Nothing Then
MsgBox "No records found"
ElseIf (ixQuery.QueryTimedOut) Then
MsgBox "Query Timedout"
ElseIf ( queryRS.EOF or queryRS.BOF or queryRS.RecordCount <= 0 ) Then
msgbox cstr(queryRS.RecordCount)
'MsgBox "No Matches found"
Else
queryRS.PageSize = rowCount
MsgBox cstr(queryRS.PageSize)
If (Err.Number <> 0) Then
MsgBox "Record Display Error: " & Err.Description
End If
End If
End If
-- modified at 2:35 Tuesday 29th August, 2006
rakeshsharma
|
|
|
|