![]() |
|
|||||||
| VB.NET General Discussion VB.NET general discussion area |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I'm new to Vb.net - I'm just setting up some sample applications to try and get a hang of it I'm just wondering can you send emails with voting buttons in vb.net? And if so can the response be sent back to the server and inserted into the database? Can anyone direct me to some sample code on this? Or any articles that might help me? Thanks. |
|
|||
|
Here's how to using Outlook Automation.
Code:
Dim appOutlook As New Outlook.Application Dim mmOutlook As Outlook.MailItem = appOutlook.CreateItem(Outlook.OlItemType.olMailItem) With mmOutlook .To = "user@domain.com" .Subject = "Vote!" .Body = "Message Body" .VotingOptions = "Yes; No; Maybe So" .Send() End With mmOutlook = Nothing appOutlook = Nothing Something like: Code:
yoursite.com/vote.aspx?recipient=1234&vote=1 Last edited by MattP; 12-01-2008 at 3:32 PM. |
|
||||
|
Eww.. Automation requires outlook, which costs money hence not guaranteed to exist. Try System.Net.Mail instead
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ |
|
|||
|
Hi, maybe you could help me a little further?
So far I have managed to send an email from my app using System.Net.Mail.MailMessage And I can send the email, but I wanted to add buttons to this message, like Approve / Decline - which would send a message back to the database and store which option was selected. Now I have been searching on the web this morning on HTML forms in vb.net and things like this but I cannot get the information I have been looking for. I used PHP before (for college) and I tried using this, which did work in that it put the buttons into the email being sent, but of course it didn't do anything else because I wasn't sure how to use the postback, and I don't really want to go down this route unless it is the only way to do it. So is there a way to send a System.Net.Mail.MailMessage email with buttons in it, and can you direct me to a tutorial or something for this? Can I get it to put the value of the button selected into the database? Sorry this might seem like silly questions, but when your just learning it's difficult to find where to start. Thanks for answers so far. |
|
||||
|
Of course; you can form an HTML page and send it in the mail, the HTML can contain a FORM whose target is your php page, and thus the buttons would cause POST data values to be submitted to the page. Even simpler, you can maybe just include links of the form:
<a href='http://myserver.com/mypage.php?id=1234&action=y'>Yes</a> <a href='http://myserver.com/mypage.php?id=1234&action=n'>No</a> Beware using images in emails; its a common trick by spammers to find out when/if a mail was viewed (your browser/client opens the mail, retrieves the image and the webserver logs the image retrieval thereby knowing your email address is valid and read. Outlook etc protect this by removing picture links until a "download pictures" option is chosen. Not cool for your purposes
__________________
DW1: Data Walkthroughs 1.1...DW2: Data Walkthroughs 2.0...DDS: The DataSet Designer Surface...ANO: ADO.NET2 Orientation...DAN: Deeper ADO.NET...DNU...PQ |
|
|||
|
Quote:
|
|
|||
|
Yeah! I realised that it was the same as what you had written at the end of your post, I didn't know what to do with yours until I tried out the PHP stuff myself today!
![]() I still don't know fully what I'm doing (I'm a newbie!!!) ![]() That's why I didn't know what to do after I put the buttons in the email, but I'm sure I'll figure it out soon. |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|