# One File One Mail



## Ron (Dec 25, 2008)

Guys,

I need to send around(50 Files worth of 200 MB) to a particualr id. but there is a problem that is i need to send them seprately i.e. One Mail for One File thus in total 50 mails for 50 Photographs.......

Its quite irritating as well as frustrating to attach a single photo and then  click send and repeat this steps for 50 times...

I am using Outlook Express for sending mails.Thus is there any option in Outlook express or other Email Software which wil help me to doing this work.....

thnks in advance

Ronak


----------



## gforce23 (Dec 25, 2008)

What's the problem with sending it across as one rar/7z file?


----------



## amitash (Dec 25, 2008)

^Your not allowed to attach such a large amount of data to one mail AFAIK

Anyway just Zip the files and upload them for free in rapidshare(you have to create a free collectors account)..then you will get a link, just send this link to the person who wants to take the files and ask them to download from there.

Note: In rapidshare each file can contain a maximum of 200mb, so if all your photos exceed 200MB just make to separate zip files of 100mb each or something and upload them separately.


----------



## mrintech (Dec 25, 2008)

share using: *www.adrive.com/


----------



## Sukhdeep Singh (Dec 25, 2008)

1.RAR Them
2. Upload them to mediafire.com
3. Send the Link across via Mail


----------



## gforce23 (Dec 25, 2008)

amitash said:


> ^Your not allowed to attach such a large amount of data to one mail AFAIK


I'm guessing you haven't kept track of the latest e-mail products?? 

@Ron, get a free Lycos Mail ID (click here) to upload the file. The free service supports an unlimited file attachment size.


----------



## QwertyManiac (Dec 26, 2008)

If you're using GMail, this *Python* script will work:


```
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
import os, glob

def mail(server, port, user, password, to, subject, text, attach):
    msg = MIMEMultipart()
    subject +=  " " + os.path.basename(attach)
    msg['From'] = user
    msg['To'] = to
    msg['Subject'] = subject

    msg.attach(MIMEText(text))

    part = MIMEBase('application', 'octet-stream')
    part.set_payload(open(attach, 'rb').read())
    Encoders.encode_base64(part)
    part.add_header('Content-Disposition',
           'attachment; filename="%s"' % os.path.basename(attach))
    msg.attach(part)

    mailServer = smtplib.SMTP(server, port)
    mailServer.ehlo()
    mailServer.starttls()
    mailServer.ehlo()
    mailServer.login(user, password)
    print("Sending... " + subject)
    mailServer.sendmail(user, to, msg.as_string())
    # Should be mailServer.quit(), but that crashes...
    mailServer.close()

if __name__ == '__main__':
    user = raw_input("From address: ").strip()
    password = raw_input("Your password: ").strip()
    to = raw_input("To address: ").strip()
    # Set to "" if none needed.
    subject = raw_input("Enter a subject: ").strip()
    # Set to "" if none needed.
    body = raw_input("Enter the message: ").strip()
    directory = raw_input("Directory of images: ").strip()
    # Or set to /*.ext if you want only specific extensions
    # to be sent.
    server = 'smtp.gmail.com'
    port = 587
    lis = glob.glob(directory+"/*.*")
    print_list = "\n".join(lis)
    print("Files to send: \n" + print_list)
    print("Sending")
    for fil in lis:
        mail(server, port, user, password, to, subject, body, fil)
```

It prompts for your mail id, password, to, etc. And a directory of your images to get all 50 file names from. Then it sends them one by one.


----------



## mrintech (Dec 26, 2008)

^^^ 

good work 

Can you tell some details how to use this script?


----------



## RCuber (Dec 26, 2008)

QwertyManiac said:


> If you're using GMail, this *Python* script will work:
> 
> 
> ```
> ...


Ha ha..When I saw this tread for the first time.. I knew you will give a script solution  .. man I am good in guessing what people will post , may be I will open a astrology kiosk


----------



## Ron (Dec 26, 2008)

Firstly thnanks for posting!!

@##Guys i am using a paid ID through which I can send large no of data but the prob is that the server doesnot allow me  to upload x or more than tht Mb of data in one mail..so i thought to send-"one file,one mail"....

@##Without any problem i could have send 5-10 files per mail but i wanted to know if there is any option/software which would let me to send one file in one mail.

@##I dont want to upload the files in any website coz it will take more time

@QwertyManiac 
thnks buddy for posting it. I wil run and tell u. tnks again


----------



## hell_storm2006 (Dec 26, 2008)

Simple man.... you and the person you are sending to get a lycos mail id. It provides unlimited attachment size capacity. 

www.lycosmail.com


----------



## red_devil (Dec 26, 2008)

/* sorry for going off topic */

hey QM how does that script work ??


----------



## Ron (Dec 26, 2008)

hey Qm i am sorry coz i dont knw hw to run tht phython file as i am not a programer.



hell_storm2006 said:


> Simple man.... you and the person you are sending to get a lycos mail id. It provides unlimited attachment size capacity.
> 
> www.lycosmail.com



thnks dude but i want to send through the paid id. Moreover i want to see whether i can send one file in one mail or not.


----------



## QwertyManiac (Dec 26, 2008)

Just download and install Python (Here's a download link to x86 32-bit Python and one for AMD 64-bit Python). Save that script as a file with .py as extension (file.py) and run the file, it will ask you for details then on.

(Double click should execute it (file.py) once you have installed Python).

You don't need to be a programmer to use it, nor to modify it to your tastes (server, port, etc) 

Apologies for not having explained it earlier, was sleepy! But I'm surprised you've not come across .py scripts so far, must write a guide!

P.s. I have not tested this directly on Windows, but if the path is giving the errors, try giving the full path with forward-slashes than back-slashes, no matter if its Windows. On *nix it should work perfectly fine. Note that you gotta give absolute paths, not relative. (i.e. full C:\Program Files\Etc must be given). And if you cant do it yourself, tell me your server's smtp details (and ssl yes/no), I shall edit it for you.


----------



## Ron (Dec 27, 2008)

@QwertyManiac 
Budddy the script is working. I tested it by sending 5 phots and it went with no probs.

I dont hv any word to say. I can just say <b>"thanks"</b>

hey dude, Suppose i want to send 5 photos in one mail than which line should i edit:
Should  i edit the following line?
   print_list = "\n".join(lis)
    print("Files to send: \n" + print_list)

and hey thnks again!!



QwertyManiac said:


> P.s. I have not tested this directly on Windows, but if the path is giving the errors, try giving the full path with forward-slashes than back-slashes, no matter if its Windows. On *nix it should work perfectly fine. Note that you gotta give absolute paths, not relative. (i.e. full C:\Program Files\Etc must be given). And if you cant do it yourself, tell me your server's smtp details (and ssl yes/no), I shall edit it for you.



Dude, dil managa more.......
This script works fine with all those id's which i have added in the outlook express but doesnot work for those like hotmail,Yahoo. I want to knw the reason behind it.Does this script communicates with the Outlookk express and thn to the server or it send directly
thnks

and ya at first the script was nt runnin coz i saved it in the desktop and gave tha path e:\Photos. Hwever after savin the script in the sam parent folder. it worked fine....


----------



## mrintech (Dec 27, 2008)

Will try this script 

Thanks I didn't knew this


----------



## QwertyManiac (Dec 27, 2008)

No, currently it will not send 5 photos batched together, it is not looped in the attachment part. Do you want a more specific script? If so, list out your complete requirements and I'll prepare it.

And it works only for GMail (smtp.gmail.com, 587). And any other SSL using SMTP server if you modify the server and port values.

Script directly connects to GMail's server and sends the mail. No connection with Outlook nor any other client.


----------



## Ron (Dec 28, 2008)

QwertyManiac said:


> No, currently it will not send 5 photos batched together, it is not looped in the attachment part. Do you want a more specific script? If so, list out your complete requirements and I'll prepare it.
> 
> And it works only for GMail (smtp.gmail.com, 587). And any other SSL using SMTP server if you modify the server and port values.
> 
> Script directly connects to GMail's server and sends the mail. No connection with Outlook nor any other client.



Hmm..thnks dude bt i dont need nw..this wscript works well.I was just asking for my GK.and hey will editin the following line wil help me to change the server 

      [FONT=&quot]server = 'smtp.gmail.com'
  port = 587[/FONT]


thnks again dude!!


----------



## QwertyManiac (Dec 28, 2008)

Yes, changing that _should_ do the trick.


----------



## Ron (Dec 28, 2008)

thnks


----------

