473,385 Members | 1,748 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.

Sending Email

I have a requirement, where a user will click on a button, and the Email new
message window will open up. The app will fill in the To: column from a
database.

I have gotten it to work, by using

Dim sEmail As String = "mailto:"
sEmail = sEmail & _
"us***@some.com;us***@some.com"
HttpContext.Current.Response.Redirect(sEmail)

However, the web browser then gets a page cannot be displayed error. How do
I open the new mail window?

I also have the same issue with other web pages. How can I dynamically open
a web page in a new browser window?

Oct 12 '05 #1
2 1425
Hi Dear Leonard,

You can send the fill in the To: column filled up from the database to a
new webpage in several ways
I will show you two ways.

1. Using QueryString - If the sEmail is not a secret data.
2. Using the Session - If the sEmail is a secret data.

for both the ways build the sEmail as you have shown (but you have not
showing filling from the database. But anyway, that you can do it)

Dim sEmail As String = "mailto:"
sEmail = sEmail & _
"us***@some.com;us***@some.com"

''To Send the QueryString to the Second form
''===========================
HttpContext.Current.Response.Redirect(WebForm2.asp x?mailtoaddress_QueryString=" + sEmail)

mailtoaddress_QueryString - change this name as per your requirement.

Whatever you send through sEmail will get attached to the Redirect URL as a
QueryString

To use the QueryString in the Second form
============================
I have show populating in the TextBox and Lable, or using in Response.Write.
You can use as you like

TextBox1.Text=Request.QueryString["mailtoaddress_QueryString"].ToString()
Label1.Text=Request.QueryString["mailtoaddress_QueryString"].ToString()

Response.Write("<b><Font color=blue>Mail to Address Using
QueryString:</Font></b>" +Request.QueryString["mailtoaddress_QueryString"])

************************************************** **********

II Way - Using Session
====
In the 1st WebPage
============

Dim sEmail As String = "mailto:"
sEmail = sEmail & _
"us***@some.com;us***@some.com"

Session["mailtoaddress"]=sEmail;

In the 2nd WebPage
=============

TextBox1.Text=Session["mailtoaddress"]).ToString()

Label1.Text=Session["mailtoaddress"]).ToString()

Response.Write("<b><Font color=blue>Mail to Address Using
QueryString:</Font></b>" + Session["mailtoaddress"])

For Anything and Everything, please let me know

bye
Venkat_KL
Oct 12 '05 #2

But how do I open the 2nd web page in a different browser?

"Venkat_KL" wrote:
Hi Dear Leonard,

You can send the fill in the To: column filled up from the database to a
new webpage in several ways
I will show you two ways.

1. Using QueryString - If the sEmail is not a secret data.
2. Using the Session - If the sEmail is a secret data.

for both the ways build the sEmail as you have shown (but you have not
showing filling from the database. But anyway, that you can do it)

Dim sEmail As String = "mailto:"
sEmail = sEmail & _
"us***@some.com;us***@some.com"

''To Send the QueryString to the Second form
''===========================
HttpContext.Current.Response.Redirect(WebForm2.asp x?mailtoaddress_QueryString=" + sEmail)

mailtoaddress_QueryString - change this name as per your requirement.

Whatever you send through sEmail will get attached to the Redirect URL as a
QueryString

To use the QueryString in the Second form
============================
I have show populating in the TextBox and Lable, or using in Response.Write.
You can use as you like

TextBox1.Text=Request.QueryString["mailtoaddress_QueryString"].ToString()
Label1.Text=Request.QueryString["mailtoaddress_QueryString"].ToString()

Response.Write("<b><Font color=blue>Mail to Address Using
QueryString:</Font></b>" +Request.QueryString["mailtoaddress_QueryString"])

************************************************** **********

II Way - Using Session
====
In the 1st WebPage
============

Dim sEmail As String = "mailto:"
sEmail = sEmail & _
"us***@some.com;us***@some.com"

Session["mailtoaddress"]=sEmail;

In the 2nd WebPage
=============

TextBox1.Text=Session["mailtoaddress"]).ToString()

Label1.Text=Session["mailtoaddress"]).ToString()

Response.Write("<b><Font color=blue>Mail to Address Using
QueryString:</Font></b>" + Session["mailtoaddress"])

For Anything and Everything, please let me know

bye
Venkat_KL

Oct 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
0
by: praba kar | last post by:
Dear All, I have doubt regarding mail sending smtplib module. The below code is I used to send a mail. ########################################## import email.Message import email.Utils...
3
by: VB Programmer | last post by:
I have an ASPX page where I send out emails through my mail server mail.MyDomain.com. When I send emails to MyName@MyDomain.com it sends PERFECTLY. When I try sending an email to any other address...
3
by: Ant | last post by:
Hi, I'm using the MailMessage & smtpMail classes in System.Web.Mail to send mail, however it's not sending any emails. I'm using it on a Windows 2003 server. The simplest way to use this is...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: =?Utf-8?B?QWRl?= | last post by:
HI All, I am encountering the following error when I try to send an email through a SMTP server. I believe the problem lies with the authentication part when the network crednetials are used,...
9
by: JoeP | last post by:
Hi All, How can I find the reason for such an error: Failure sending mail. Some Code... oMailMessage.IsBodyHtml = False oMailMessage.Body = cEmailBody Dim oSMTP As New SmtpClient...
7
by: bleachie | last post by:
Hey, I just need some help, my form seems to not send me all of the 'guestNames' and 'guestEmails' forms. i use this function to add more guestnames and guestemail fields based on the number of...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
31
by: happyse27 | last post by:
Hi All, I am trying for weeks how to send email from windows pc, which from my gmail account to my hotmail account. Using net::smtp module sending email failed,Kindly assist. (for the item d it...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.