473,394 Members | 1,714 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,394 software developers and data experts.

Sending mail from page

I am trying to send mail from web page in asp.net 2.0/VB 2005:

Dim Poruka As New System.Web.Mail.MailMessage

myMessage.From = "ma*******@gmail.com"
myMessage.To = "ma*******@hotmail.com"
myMessage.Subject = "Automatic sending mail"
myMessage.Body = "Success!"
Mail.SmtpMail.Send(myMessage)

There is no error message! Only message that recomended is
System.Net.Mail.MailMessage instead System.Web.Mail.MailMessage.
Compiling is ok, but messages is not sent. I changed myMessage.To adresses,
but nothing! How to fix it?

Thanks
Nov 17 '06 #1
4 1045
Hi,

I do not think your smtp server is sending the message. You might
want to connect to a smtp server to send them

Dim client As New SmtpClient("mail.YourServer.com")
client.Credentials = New Net.NetworkCredential("UserName",
"YourPassword")
Dim mm As New MailMessage("ma*******@gmail.com",
"ma*******@gmail.com")
mm.Subject = "Automatic sending mail"
mm.Body = "Success!"

Try
client.Send(mm)
Catch ex As Exception
' handle the error
End Try

Ken
-------------------
"Zile" <bo******@yahoo.comwrote in message
news:ej**********@sunce.iskon.hr...
>I am trying to send mail from web page in asp.net 2.0/VB 2005:

Dim Poruka As New System.Web.Mail.MailMessage

myMessage.From = "ma*******@gmail.com"
myMessage.To = "ma*******@hotmail.com"
myMessage.Subject = "Automatic sending mail"
myMessage.Body = "Success!"
Mail.SmtpMail.Send(myMessage)

There is no error message! Only message that recomended is
System.Net.Mail.MailMessage instead System.Web.Mail.MailMessage.
Compiling is ok, but messages is not sent. I changed myMessage.To
adresses, but nothing! How to fix it?

Thanks


Nov 17 '06 #2
Again! Compile is ok, but mail is not comming. What can be problem? I am
running this aspx page on my local server on my computer it is not on web
hosting account. Is this can be a problem? Which smtp server I must to put,
from my web hosting account or from my outlook express if I am running aspx
on my computer?
Nov 17 '06 #3
"Zile" <bo******@yahoo.comwrote in message
news:ej**********@sunce.iskon.hr...
Which smtp server I must to put, from my web hosting account or from my
outlook express if I am running aspx on my computer?
Whichever one allows you to send emails from your local computer.

E.g. my hosting service is hostinguk.net, and they allow web applications
deployed on their servers to send outgoing email using their SMTP queue on
relay.hostinguk.net.

However, this will not work from my local machine because that SMTP queue
will not recognise it as part of its internal network, otherwise they'd be
inundated with spammers relaying email through their servers...

Therefore, when I'm developing and testing from home, I need to use my ISP's
SMTP queue, which is smtp.blueyonder.co.uk - at this point, the email can be
sent because that SMTP queue recognises my machine as valid on their network
because it has been assigned an IP address from their DHCP pool.
Nov 17 '06 #4
Couple of things:

1) you must have access to a smtp server that can relay mail on your
behalf.
2) Said smtp server must be configured to allow relay of email

If you have established this you can modify your code as follows:

myMessage.From = "ma*******@gmail.com"
myMessage.To = "ma*******@hotmail.com"
myMessage.Subject = "Automatic sending mail"
myMessage.Body = "Success!"
'Replace mail.server.com with your smtp server
SmtpMail.SmtpServer = "mail.server.com"
SmtpMail.Send(Message)

On Fri, 17 Nov 2006 12:27:07 +0100, "Zile" <bo******@yahoo.comwrote:
>I am trying to send mail from web page in asp.net 2.0/VB 2005:

Dim Poruka As New System.Web.Mail.MailMessage

myMessage.From = "ma*******@gmail.com"
myMessage.To = "ma*******@hotmail.com"
myMessage.Subject = "Automatic sending mail"
myMessage.Body = "Success!"
Mail.SmtpMail.Send(myMessage)

There is no error message! Only message that recomended is
System.Net.Mail.MailMessage instead System.Web.Mail.MailMessage.
Compiling is ok, but messages is not sent. I changed myMessage.To adresses,
but nothing! How to fix it?

Thanks
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 17 '06 #5

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

Similar topics

1
by: TMN | last post by:
We have an ASP-based call center application that our call center operators use to track calls and forward job assignments. This app replaces a VB6-based client-server app used previously. In the...
2
by: Mr. x | last post by:
Hello, I am sending emails with Hebrew contents. When receiving emails - I cannot see the Hebrew characters (it is not outlook express configuration, because when receiving emails from friends -...
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...
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
6
by: Eduardo Rosa | last post by:
Somebody knows how I queue email using .Net? thanks a lot
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...
3
by: armando perez | last post by:
Hi, this is my first time here, but I was looking for something that may help me, and still, I haven't found something to use. I'm using a website made in .NET with C#, when I'm running my site...
5
by: Zile | last post by:
I am trying to send mail from web page in asp.net 2.0/VB 2005: Dim Poruka As New System.Web.Mail.MailMessage myMessage.From = "matematic@gmail.com" myMessage.To = "matematic@hotmail.com"...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
2
ThatThatGuy
by: ThatThatGuy | last post by:
Hello reader,, This might be a very simple question, but what to just say about it, i'm facing it Actually i'm developing a web App and i want email feature in that.... I'm sending mail from my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.