Mailen zonder outlook

Status
Niet open voor verdere reacties.

linkav

Gebruiker
Lid geworden
13 jun 2007
Berichten
465
Beste,

Ik wil een mail versturen vanuit vba-code maar ik heb geen outlook op die PC staan. Hoe doe ik dat?

Gr,
Ariane
 
Als je een mailclient hebt, en dat zal toch wel?, kun je met SendObject werken. Iets als:
Code:
    DoCmd.SendObject acSendReport, "testrapport", acFormatPDF, mailadres, , , "test bericht", "Dit is een mail"
 
Dan valt er ook niet te mailen :).
 
Beste,

Ik wil een email versturen vanuit vba via one.com, dus ik heb de smtp-gegevens/gebruiker+wachtwoord

Gr,
Ariane
 
Beste,

Ik kan wel windows live (mail live) gebruiken?

Gr,
Ariane
 
Ik heb een voorbeeldje vanuit GMail; dat is wellicht simpel om te bouwen. Je moet in ieder geval de bibliotheek Microsoft CDO aanzetten.
Code:
Sub SendEmailUsingGmail()
Dim NewMail As CDO.Message

    Set NewMail = New CDO.Message
    'Enable SSL Authentication
    With NewMail
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
        'Make SMTP authentication Enabled=true (1)
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        'Set the SMTP server and port Details
        'To get these details you can get on Settings Page of your Gmail Account
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        'Set your credentials of your Gmail Account
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "jouwnaam@gmail.com"
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "*********"
        'Update the configuration fields
        .Configuration.Fields.Update
        'Set All Email Properties
        .Subject = "Test Mail from LearnExcelMacro.com"
        .From = "jouwnaam@gmail.com"
        .To = "aanwie@gmail.com;info@learnexcelmacro.com"
        .CC = "nogiemand@gmail.com"
        .BCC = ""
        .textbody = ""
        .send
    End With
    
    MsgBox ("Mail is verstuurd ...")
    'Set the NewMail Variable to Nothing
    Set NewMail = Nothing
   
End Sub
 
Hier een linkje naar het Live verhaal.
 
Het is opgelost met CDO!!! Heel erg bedankt...

Gr,
Ariane
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan