473,883 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

send automatic mail

2 New Member
hi ,
i'm trying to sned a mail in my web (ASP.NET) ,i want to be able to send mails to my clients who have hotmail yahoo or gmail accounts....fro m different accounts also ....

in web.config
Expand|Select|Wrap|Line Numbers
  1. <system.net>
  2.     <mailSettings>
  3.       <smtp from="" deliveryMethod="network">
  4.         <network host="smtp.sigorta-online.com" port="25"  defaultCredentials="true" />
  5.       </smtp>
  6.     </mailSettings>
  7.   </system.net>
my function is :
Expand|Select|Wrap|Line Numbers
  1.  Public Shared Function SendMail(ByVal strFrom As String, ByVal strTo As String, ByVal strSubject As String, ByVal strMsg As String) As Boolean
  2.         Try
  3.             ' Create the mail message
  4.             Dim objMailMsg As MailMessage = New MailMessage(strFrom, strTo)
  6.             objMailMsg.BodyEncoding = Encoding.UTF8
  7.             objMailMsg.Subject = strSubject
  8.             objMailMsg.Body = strMsg
  9.             objMailMsg.Priority = MailPriority.High
  10.             objMailMsg.IsBodyHtml = True
  12.             'prepare to send mail via SMTP transport
  13.             Dim objSMTPClient As SmtpClient = New SmtpClient()
  14.             'objSMTPClient.EnableSsl = True
  15.             objSMTPClient.Credentials = CredentialCache.DefaultNetworkCredentials
  16.             objSMTPClient.UseDefaultCredentials = True
  17.             objSMTPClient.DeliveryMethod = SmtpDeliveryMethod.Network
  18.             objSMTPClient.Send(objMailMsg)
  19.             Return True
  20.         Catch ex As Exception
  21.             Throw ex
  22.         End Try
  23.     End Function
it gives me this error message :
Mailbox unavailable. The server response was: <> No such user here
and when i put 'localhost" in my smtphost it gives me this error :
Failure sending mail.Unable to connect to the remote server
....any ideas ?
Oct 2 '09 #1
0 1741

Sign in to post your reply or Sign up for a free account.

Similar topics

by: David Burson | last post by:
Hi, I have a VB.NET windows app that needs to automatically send a simple text email when my users run a new version of the app for the first time. I thought this would be simple, but after days of reading posts and testing, I see it is not - unless I'm missing something? I'm not an email guru. All of my users will be running at least Windows 2000, most on XP sp2. Some of my users will have Outlook, many will be using Outlook...
by: Andy G | last post by:
Hi, My plan is to use Try Catch statements to catch an error and then email it to myself. I send the user to a custom error page and I would like to email myself the asp.net error. I thought that I would just call a function to send a mail in the Catch area of the Try Catch statement but it didn't work, or maybe I just had it set up wrong. What is the best way to accoplish this task, using a Try Catch or something else? Thanks.
by: zek2005 | last post by:
Hi Friends!!! I want to create an option to the user to suscribe to a service that sends an automatic mails everyday with information taken from a database created in MySQL. I have the form and the access with PHP to the database and I can send an automatic mail at the moment that the users press a button to activate the action, but I do not know how to do it everyday (or the period of time chosen by the user).
by: Senthilkumar | last post by:
Hi, I would like to send mail using Outlook or Outlook Express my .net program which is written using vb.net . When ever a new record of particular type is added, i would like to send an automatic mail using Outlook. I thought of using commercially available components but i would like to store the mails also which is not available in these components and hence the desire to use outlook. Where is the best place to start.
by: Tidan | last post by:
Hi, I would like to send mail using Outlook Express my .net program which is written using vb.net 2.0. When ever a new record of particular type is added, i would like to send an automatic mail using Outlook Express . Where is the best place to start. Thanks
by: JBuckner | last post by:
My macro uses the Send Object (VBA Item.Send) function to email a spreadsheet to an Outlook contact list. I want the function to be completely automatic but Outlook displays a security warning message (...another program is attempting to automatically email...) that requires user intervention before the macro will finish execution. Can anyone advise me on how to disable the Outlook warning? I tried the Warnings Off function but realized it...
by: refv8 | last post by:
hi, i´m doing a aplication in asp.net 2.0 and i want send an automatic mail when the users do an operations. i use the library System.Net.Mail.MailMessage. and I specify all the properties (to,from,body,host and port). i want send the mail by another port not from the port 25. Can i do That?. I dont specify credencials. i configure the server to the port that i want send in the IIS, but its not works. ...
by: navyliu | last post by:
I want send Lotus Notes Email automatic in my Application.I googled this topic but I can't find the solution. Does anyone have ever use this function?Can you give me some advice? Thanks a lot!
by: pat | last post by:
Hi, i'am using an ac2K progrom which sends automaticle emails with an attachment. Since last week , a error occurs with number 2293. Our mail program is Outlook 2003. It's probably a matter of safety in outlook, but i didn't saw an answer to prevent this error on theweb. Where can i configure the safetyitem that Outlook sees the mail not langer
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.