Hi,

I need some help how to include multiple email addresses in a radio button. This radio button will hold at least 2 email addresses within an organization. After user clicks the Submit button in a form. The email addresses will go directly on the To: of the Inbox.

I am not sure how to go about this problem? It has been a few months I have learn how to program in ASP.

For example:
Choose what type of suggestions:
<input type="radio" name="web enhancement" value="jennyg@company.com">Web Enhancements/ Comments</input>
-- After clicking the submit, the email address will show up on the To: field --
I am trying to figure out this problem for 2 days, but somehow I have tried

strTo: didn't work
strTo As String = txtEmail.text

I appreciate any help.

Recommended Answers

All 3 Replies

strTo As String = txtEmail.text is not asp, that is ASP.NET. If you are using ASP Classic (Regular ASP), then to add multiple email addresses just do it like a normal mailto thing:

<label><input type="radio" name="web enhancement" value="jennyg@company.com;email@two.com;email@three.com">Web Enhancements/Comments</label>

</input> is not a tag, what you are looking for is label.

Now the above code is for website use only. If you are talking abouta link to click that opens an email program, then you need the mailto: command done by a link or backend asp coding.

<a href="mailto:jennyg@company.com, jenn2@company.com"></a>

This is not a safe method as no guarantees how browsers will read the code. Your best bet is to do a backend asp page reading the radio button, then email within that page. If you have more questions, feel free to respond.

I don't want a link that has a mailto:jenny@company.com.

I want a radio button which holds 2 email addresses as values. I think the backend asp page has to read the radio button-- which is good advice.

I cannot distinguish between asp or asp.net languages.

So the above code may work-- let me check on it first. But I may acquire some backend asp coding to see if this radio button is selected, and after the submit button is pressed. Thus, it goes to 2 email addresses.

So does this go to only aspx webpages and not outputting the results via email.

Yes, but you will have to split the string and send it to each email address separatly. An example would be something like this:

Dim s As String = Request.Form("radioemail")
'radioemail is an ID that you will have to set for your entire radio list.
'You will need an id for your radiolist to prevent multiple choices.
Dim a As String = Split(s, ";")
For each a in s
  'your email code here with the follow code:
  Dim strTo As String = a
  'now do the rest of your code
Next
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.