SMTP Email from Access 2003

M

Mike Charney

Is there a simple way to send SMTP email from Access VBA?

I do not want to send any file or attachments.

Mike
m charney at dunlap hospital dot org
 
D

Dirk Goldgar

Mike Charney said:
Is there a simple way to send SMTP email from Access VBA?

I do not want to send any file or attachments.

Are you looking to bypass the user's default mail client completely?
DoCmd.SendObject won't do it for you?
 
M

Mike Charney

There is no user on this system. It is an XP Pro system in my server room.

I need to send an email from it when the code is done running and/or when
there is an error.

mike
 
D

Dirk Goldgar

Mike Charney said:
There is no user on this system. It is an XP Pro system in my server
room.

I need to send an email from it when the code is done running and/or
when there is an error.

So you need to get around the e-mail security prompt. I suppose you
could run ClickYes on the server, but using your own SMTP client would
be preferred.
 
P

percussion86

Hello everyone. i have a big, big problem in my work regading sending
email to emails found on a table (in access). this requires me to use
VBA codes. This is currrently what i am using but there is an error
when i click on the send e-mail button (the problem as stated in access
lies in the mail.To function. Another funny thing is that i cannot send
to hotmail addresses except my company addresses. Can anyone expert in
this field help me??i am in deep trouble if i can't finish this by
friday. any help will be much appreciated. Thank You very much.

Private Sub cmdSend_Click()
Dim db As Database
Dim rs As Recordset
Dim mail As New CDONTS.NewMail
Dim strBodyContent As String
Dim Email As String


Set db = CurrentDb
Set rs = db.OpenRecordset("qryEmail")


rs.MoveFirst
Do Until rs.EOF

Email = Email & rs!Email & "; "



mail.To = Email
mail.BodyFormat = Text
mail.Subject = "United Parcel Service Job Opportunity"
mail.From = txtSenderEmail
mail.AttachFile (txtJobDescription)


strBodyContent = "Dear " & rs!Name & ", " & vbCrLf & vbCrLf &
"UPS is currently recruiting " & txtPosition & " in " & txtDepartment &
" Department. Enclosed is the job description for this position. We
would like to invite you to take up this opportunity by sending us your
updated resume to " & txtSenderEmail & ". The closing date for
submission will be on " & txtClosingDate & ". " & vbCrLf & vbCrLf &
"Please e-mail me if you have any queries on the above position. Thank
you. " & vbCrLf & vbCrLf & vbCrLf & "Regards, " & vbCrLf &
txtSenderName & vbCrLf & txtSenderDepartment & vbCrLf &
txtSenderCompany & vbCrLf & "Email: " & txtSenderEmail & ""


mail.body = strBodyContent




mail.Send

rs.MoveNext
Loop






MsgBox "Completed"

End Sub
 
D

Dirk Goldgar

Hello everyone. i have a big, big problem in my work regading sending
email to emails found on a table (in access). this requires me to use
VBA codes. This is currrently what i am using but there is an error
when i click on the send e-mail button

What is the exact error message and number? What do you mean by "the
problem as stated in access lies in the mail.To function"?
Another funny thing is that i
cannot send to hotmail addresses except my company addresses. Can
anyone expert in this field help me??

I haven't a clue as to why that might be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top