Results 1 to 19 of 19

Thread: mail without need to push send button

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    mail without need to push send button

    I know how to create an email message with the

    dim mail as process
    mail.start(mailto:..........)

    but is there a way to create a mail message and send it without showing it to the user?
    If so. How?

    Thanks
    //Martin Andersson

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Use system.web.mail class.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    As VB app it's ganna be a way frustrated . You need IIS running or any COM+ that acts as relay server to be able to send msgs . Someone told me he can does this with Socket yet he never replied me . If that's for ASP , it's easier . Search here or google it . A lot of examples around .

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Originally posted by Pirate
    You need IIS running or any COM+ that acts as relay server.
    I dont think so, if you can use a smtp mail server (the one that you actually use when using outlook or such) then you can use that without the need for IIS.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Sorry it's my fault . Still confusing IIS with SMTP . Pretty easy but I've just got back from work . .......... .

  6. #6

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Pirate:
    I have searched but didn´t find any examples ... Maybe you can do a search and help me?

    Lunatic3 that works for a VB.net project? Do I have to create a own mail server or can I use my mailto line?
    Or is it any other way that I can use my mailto line?

    The mail is opened and created in MS Outlook but it´s the last thing. It won´t send, even if I got the adress,subject ... etc etc...
    So if it´s a command for the send button or something?

    Thanks for the help
    //Martin Andersson

  7. #7
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I am a little confused about your question. Do you want to know how to send an email using outlook and such or you want to write a VB .NET application to do that?
    In order to send mail using outlook (or outlook express or any other mail client) you need a mail server (that actually does the task of sending your email). In most cases the ISP's provide a mail server for you that you can set in the outlook express and use it, however if you are running IIS on Windows XP, 2000, or 2003 then your mail server can be yourself.
    But if you want to send emails using VB .NET then one way will be using that System.Web.Mail class.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Lunatic3
    But if you want to send emails using VB .NET then one way will be using that System.Web.Mail class.
    Plus SMTP server . Generally , it comes as OCX or DLL .

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    That's in case you didn't provide your reall SMTP Server address. If you have it , you can add it to your mail settings .

  10. #10

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Ok. Going to try and explain.
    I got a VB.net program that checks dates in a database.
    If that date gets to old I want an mail to send.
    But I don´t want it to be visible to the user.

    At the moment I´m using the mailto line. but it opens a email message and the user have to push the send button. I want the program to send it without the need of pushing the send button.

    I need a mail server for that? Or can it be done on an easier way?

    I have searched for the web mail class but haven´t found anything. Maybe I´m searching on the wrong place/words
    //Martin Andersson

  11. #11

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Tried to work with smtp.
    This is what I got atm.

    Dim mailinfo As New System.Web.Mail.MailMessage()
    With mailinfo
    .From = "you@urplace"
    .To = "myself$my.house"
    .Subject = "My SMTP Test"
    .Body = "My New Message"
    End With

    SmtpMail.SmtpServer = "MyServerName"
    SmtpMail.Send(mailinfo)


    But the thing is that system.web.mail.mailmessage aint defined.
    I try to import system.web.mail at the top but it says it can´t be found.
    Anything missed in the install or something else?
    Thanks for answers
    //Martin Andersson

  12. #12
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Did you reference System.Web.dll to your proj ?

  13. #13

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Probably not.
    When I refere to a dll it´s the same as the imports? like
    import system.web.dll
    ?
    //Martin Andersson

  14. #14
    Addicted Member
    Join Date
    Nov 2001
    Posts
    181

    Mail error

    Hi All,

    I used "System.Web.Mail" to send mails from my application. When i tried to run the code i got the following error i don't have permissions for the assembly to do it, give appropriate permissions using Microsoft .Net security policy administration tool. Where I can i find this tool in my machine and how to solve the same. Treat this as urgent. Thanks in advance.

  15. #15
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by Iceman5
    Probably not.
    When I refere to a dll it´s the same as the imports? like
    import system.web.dll
    ?
    Not really . First you have to reference the dll . Then use 'Imports' keyword to import (use) the functions or classes existed in that dll . 'Imports' is just a way to organize your code and shorten the declaration of objs in .NET .

  16. #16

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Found the import of dll etc.
    But got a problem with cdo. Still checking for a solve to it.
    Searching for the file so I can include it.
    Haven´t got time to check it that much yet though.

    Thanks for the help all.
    //Martin Andersson

  17. #17
    Addicted Member
    Join Date
    Nov 2001
    Posts
    181
    Hi Pirate,

    Thanks a lot ,I tried by importing System.Web.Mail namespace It worked.

    How to authentication username and password when sending SMTP mails?.

  18. #18
    Addicted Member
    Join Date
    Nov 2001
    Posts
    181
    Hi Pirate,

    Thanks a lot ,I tried by importing System.Web.Mail namespace It worked.

    How to authenticate username and password when sending SMTP mails?.

  19. #19
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I've not seen this before , see this example :http://www.codeproject.com/csharp/sendmailcsharp.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width