send email via VB.NET using PHP as the mail processor ?

Hi, i hope u guys would understand what i'm sayin cuz im not sure that i do!
here is what i think i need to do:
i got a very simple PHP mail sender which i want to use with VB.NET (If possible in any way), VB would submit a couple of text fields to the PHP mailer which contains the email that would recieve the email...

If that is not possible, is there any other way i can send mail from VB.NET without having to use SMTP servers...

sorry if i'm not clear enough..

Thank you.
nkrulezAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BTosonCommented:
Hi,

I'm assuming you have a PHP script hosted somewhere which will you want to call through your VB.NET programme?
If so then why not just use a HTTP POST request?
0
nkrulezAuthor Commented:
yah that is pretty much it, but i'm a total newbie to VB.NET
could somebody plz tell me how 2 use HTTP POST request ?
0
BTosonCommented:
Simplest way is something like this.  Please don't forget to check your values before submitting them!
Dim POSTVariables = New NameValueCollection
POSTVariables.Add("email", email)
POSTVariables.Add("name", name)
Dim Request As New WebClient
Dim Result = Text.Encoding.UTF8.GetString(Request.UploadValues("http://url/to/mailer.php", POSTVariables))

Open in new window

0
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

BTosonCommented:
Oh and don't forget to put a Imports System.Net in your code behind!
0
nkrulezAuthor Commented:
But this way my clients will have to have framework installed in order for the application to work, right ?

I'm not a fan of framework .. is there any other possible way to accomplish this without having to use framework ?

thanks alot.
0
nkrulezAuthor Commented:
oh and,

Error1   Type 'NameValueCollection' is not defined.
Error2   Name 'email' is not declared.
Error3   'Encoding' is not a member of 'String'.

0
BTosonCommented:
Well as you are using VB.NET, anythign you deploy will require the relevant version of the .NET framework to be installed.

See below for namespaced/clarified code.
Dim POSTVariables = New System.Collections.Specialized.NameValueCollection
POSTVariables.Add("email", "e-mailaddresshere")
POSTVariables.Add("name", "name or whatever here")
Dim Request As New WebClient
Dim Result = System.Text.Encoding.UTF8.GetString(Request.UploadValues("http://url/to/mailer.php", POSTVariables))

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.